現在ruby on rails でwebサービスを開発中ですが、
下記のコードにて下のエラーが出てしまいます。
エラーいわく25行目(<% end %>がいるところ)が間違っているそうです。
/home/ec2-user/environment/NB-OB/app/views/users/index.html.erb:23: syntax error, unexpected keyword_end, expecting ')' '.freeze; end ^
/home/ec2-user/environment/NB-OB/app/views/users/index.html.erb:27: syntax error, unexpected keyword_ensure, expecting ')' ensure ^
/home/ec2-user/environment/NB-OB/app/views/users/index.html.erb:29: syntax error, unexpected keyword_end, expecting ')' end ^
endが抜けているのかなとおもい抜けを探しましたがそれもなく間違いの箇所を特定しようと
コードの入れ子の中を切り取ったりして場所の特定をしましたが結局わからないままです。
どこを修正すれば良いのでしょうか。
Ruby
1<div class="main users-index"> 2 <div class="container"> 3 <h1 class="users-heading">ユーザー一覧</h1> 4 <% @users.each do |user| %> 5 <div class="users-index-item"> 6 <div class="user-left"> 7 <img src="<%= "/user_images/#{user.image_name}" %>"> 8 </div> 9 <div class="user-right user-detail"> 10 <ul> 11 <li> 12 <%= link_to(user.name, user_path(user) %> 13 </li> 14 <li> 15 <%= "ポジション: #{user.position}" if user.position %> 16 </li> 17 <li> 18 <%= "活動地域: #{user.address}" if user.address %> 19 </li> 20 </ul> 21 </div> 22 </div> 23 <% end %> 24 </div> 25</div>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。