Image_tag 在节目中生成额外数据
Image_tag generating extra data on show
我有一个带有回形针的嵌套图像的图像标签。
图像显示得很好,但我有这个就在下面:
[#<图片id:8,post_id:7,created_at:"2015-12-2318:37:33",updated_at:"2015-12 -23 18:37:33", image_file_name: "Clichey3.png", image_content_type: "image/png", image_file_size: 93529, image_updated_at: "2015-12-23 18:37:33">]
这是我的节目:
<p id="notice"><%= notice %></p>
<%= @post.pictures.each do |pic| %>
<%= image_tag(pic.image.url(:medium)) %>
<% end %>
<p>
<strong>Title:</strong>
<%= @post.title %>
</p>
<p>
<strong>Description:</strong>
<%= @post.description %>
</p>
<%= link_to 'Edit', edit_post_path(@post) %> |
<%= link_to 'Back', posts_path %>
奇怪??有什么想法吗?
我认为这与此有关,您不希望在循环中使用“=”。我忘了它是'-'还是什么都没有。
<% @post.pictures.each do |pic| %>
<%= image_tag(pic.image.url(:medium)) %>
<% end %>
我有一个带有回形针的嵌套图像的图像标签。
图像显示得很好,但我有这个就在下面:
[#<图片id:8,post_id:7,created_at:"2015-12-2318:37:33",updated_at:"2015-12 -23 18:37:33", image_file_name: "Clichey3.png", image_content_type: "image/png", image_file_size: 93529, image_updated_at: "2015-12-23 18:37:33">]
这是我的节目:
<p id="notice"><%= notice %></p>
<%= @post.pictures.each do |pic| %>
<%= image_tag(pic.image.url(:medium)) %>
<% end %>
<p>
<strong>Title:</strong>
<%= @post.title %>
</p>
<p>
<strong>Description:</strong>
<%= @post.description %>
</p>
<%= link_to 'Edit', edit_post_path(@post) %> |
<%= link_to 'Back', posts_path %>
奇怪??有什么想法吗?
我认为这与此有关,您不希望在循环中使用“=”。我忘了它是'-'还是什么都没有。
<% @post.pictures.each do |pic| %>
<%= image_tag(pic.image.url(:medium)) %>
<% end %>