rails indexページでeach文書いたら、変な表示になった
railsでindex表示に失敗した話
以下のようなブラウザ表示になった
本当は、こうしたい
解決法
index.html.erb
<table>
<thead>
<tr>
<td>Title</td>
<td>Opinion</td>
</tr>
</thead>
<tbody>
<% @books.each do |b| %>
<tr>
<td><%= link_to b.title, book_path(b) %></td>
<td><%= b.body %></td>
</tr>
<% end %>
</tbody>
</table>
<% @books.each do |b| %>
でなく<%= @books.each do |b| %>
のように=
をつけていたため変な表示になっていた
間違いあれば教えてください。
Author And Source
この問題について(rails indexページでeach文書いたら、変な表示になった), 我々は、より多くの情報をここで見つけました https://qiita.com/dedeDango/items/115689b076953e374645著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .