我正在尝试使用 will_paginate 显示图像。我收到并期待keyword_end 问题。
这是引发错误的 .erb 。错误与 image_tag 一致
<h2>My Links</h2><br>
<p>Check out the links you've shared here, or <a href="/add-link">add a new link</a></p>
<p>
<strong>My Links</strong><br />
<ul class="">
<% @links.each do |link| -%>
<li> <a href="<%= link.content %>"><%= link.title %></a><br /> </li>
<li> <%= link.description %><br /> </li>
<li> <%= link.category %><br /> </li>
<% if link.image_blob %>
<%= image_tag url_for(:action => 'show_image', :id => link.id), :size => "300x200") %>
<% end %>
<% end -%>
</ul>
</p>
<%= will_paginate @links, :page_links => false %>
这是我的应用程序助手功能
def show_image
puts "in show_image"
@link = Link.find(params[:id])
send_data @link.image_blob, :type => 'image/png', :disposition => 'inline'
end