【发布时间】:2016-06-09 06:18:32
【问题描述】:
我正在使用回形针在我的 Rails 应用程序中上传和显示图像。
<% @submission.images.each do | image | %>
<%= image_tag(image.data.url(:thumb), :alt => '') %>
<% end unless @submission.images.first.new_record? rescue nil %>
上面的代码显示了图片的缩略图。
我想让缩略图成为一个链接,这样当用户点击它时,会显示一个显示原始图像的弹出窗口。
我尝试包含指向缩略图的链接,如下所示:
<%=link_to image_tag(image.data.url(:thumb)), :popup=>['original_image', 'height=700,width=900'] %>
但我不知道将弹出窗口的内容作为image_tag(image.data.url(:original)) 放在哪里
非常感谢您提供的任何建议。
【问题讨论】: