-1
在我看來,我有一個.each循環遍歷我的所有圖像。代碼做我想做的事情。出於某種原因,在所有內容正確顯示後,頁面底部會出現數據轉儲。不知道爲什麼。 這裏是我的觀點查看打印出整個分貝,不知道爲什麼
<p id="notice"><%= notice %></p>
<%= @images.each do |image| %> //this causes the data dump, not sure why and how to fix it
<% if image.name == @image.name%>
<p>
<strong>Name:</strong>
<%= image.name %>
</p>
<p>
<strong>Picture:</strong>
<%= image_tag image.picture.url if image.picture %>
</p>
<p>
<strong>Likes:</strong>
<%= image.likes %>
</p>
<%end%>
<%end%>
<%= link_to 'Edit', edit_image_path(@image) %> |
<%= link_to 'Back', images_path %>
的[第三連桿(http://stackoverflow.com/questions/4665279/why-is-this-rails-view-spitting- out-a-raw-array-end-of-each-do-loop?rq = 1)在** Related **側欄中回答你的問題。 –