开发者

How can I add lightbox to paperclip multiple uploads?

I've got a table of venues, where each record has many images uploaded using paperclip into another table of venuephotos. Currently all the photos are displayed on the venues show page using:

 <div class="venue_photos_container">
   <% for venuephoto in @venue.venuephotos %>
     <开发者_如何学C%= link_to image_tag(venuephoto.venuephoto.url(:thumb), :class => "venue_photo"), venuephoto.venuephoto.url(:original) %>
   <% end %>
 </div>

The page source shows these photos as:

<div class="venue_photos_container">
    <a href="/system/venuephotos/1/original/image2.png?1300712562"><img alt="image2" class="venue_photo" src="/system/venuephotos/1/thumb/image2.png?1300712562" /></a>
    <a href="/system/venuephotos/4/original/image3.png?1300714288"><img alt="image3" class="venue_photo" src="/system/venuephotos/4/thumb/image3.png?1300714288" /></a>
    <a href="/system/venuephotos/5/original/image4.png?1300714548"><img alt="image4" class="venue_photo" src="/system/venuephotos/5/thumb/image4.png?1300714548" /></a>
</div>

How can I go about adding lightbox to my app to display these images? The Lightbox2 guide mentions adding rel="lightbox[imagesetname]" to each link tag. I would like to have all the uploaded photos display in a single imageset on the show page.

Thanks for any help its much appreciated!


<%= link_to image_tag(venuephoto.venuephoto.url(:thumb), :class => "venue_photo", ), venuephoto.venuephoto.url(:original), :rel => "lightbox[imagesetname]" %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜