我想创建一个网格视图的照片库(类似Facebook),想知道是否只用Rails就可以实现,还是需要使用jQuery。
我正在使用Paperclip,并且在尝试以网格形式展示图片时遇到了困难。
如果有人能提供教程链接或起点,我将非常高兴。(我已经有了显示所有照片的索引视图)
index.html.erb
<% title "All Photos" %>
<table>
<% for photo in @photos %>
<tr>
<td><%= link_to image_tag(photo.image.url), photo %></td>
<td><%= link_to photo.name, photo %></td>
</tr>
<% end %>
</table>
谢谢!