Conrad Taylor
2006-Feb-25 02:14 UTC
[RAILS] Ruby Interface Recommendations Photo Gallery Creation?
Hi, I''m looking to create a gallery index page of thumbnail images which point to their associated images galleries. Also, I would like to organize the images from left to right and top to bottom. Furthermore, I would like to limit the number of thumbnail images on the page. I guess that I''m needing some type of horizontal looping interface for both the thumbnail index page and the associated image galleries. Then I would also need a navigation interface for traversing through the pages of the gallery thumbnails as well as the associated gallery pages (i.e. regular size and thumbnails images). It seems that pagination would assist me in regards to limiting the number of items on a page and creating revious and next links but does it allow one to list the items on a page (i.e thumbnails) horizontally instead of vertically? If someone can recommend a framework/interface and/or tutorial for performing this functionality, it would be most appreciated. Thanks in advance, -Conrad -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060225/c42a9a78/attachment.html
Ezra Zygmuntowicz
2006-Feb-25 05:12 UTC
[RAILS] Ruby Interface Recommendations Photo Gallery Creation?
On Feb 24, 2006, at 6:14 PM, Conrad Taylor wrote:> Hi, I''m looking to create a gallery index page of thumbnail images > which point to their associated images galleries. Also, I would > like to organize the images from left to right and top to bottom. > Furthermore, I would like to limit the number of thumbnail images > on the page. I guess that I''m needing some type of horizontal > looping interface for both the thumbnail index page and the > associated image galleries. Then I would also need a navigation > interface for traversing through the pages of the gallery > thumbnails as well as the associated gallery pages (i.e. regular > size and thumbnails images). It seems that pagination would assist > me in regards to limiting the number of items on a page and > creating revious and next links but does it allow one to list the > items on a page (i.e thumbnails) horizontally instead of > vertically? If someone can recommend a framework/interface and/or > tutorial for performing this functionality, it would be most > appreciated. > > Thanks in advance, > > -Conrad > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsConrad- Here is something to get you started. You would just use a normal pagination that fetched 9 records per page(or 4 if you want a 4x4 grid instead of 3x3) So lets say you load 9 thumbnail images into @thumbs. Then you can do this in the view to make a 3x3 grid of images: <% 0.upto(2) do |indx| %> <%= link_to(image_tag(@thumbs [indx].image), :controller=>''foo'', :action=>''bar'', :id => @thumbs [indx].id)%> <% end %> <% 3.upto(5) do |indx| %> <%= link_to(image_tag(@thumbs [indx].image), :controller=>''foo'', :action=>''bar'', :id => @thumbs [indx].id )%> <% end %> <% 6.upto(9) do |indx| %> <%= link_to(image_tag(@thumbs [indx].image), :controller=>''foo'', :action=>''bar'', :id => @thumbs [indx].id )%> <% end %> Thats should get you started. Cheers- -Ezra
Francois Beausoleil
2006-Feb-27 01:41 UTC
[RAILS] Ruby Interface Recommendations Photo Gallery Creation?
Hello Conrad, 2006/2/24, Conrad Taylor <conradwt@gmail.com>:> Hi, I''m looking to create a gallery index page of thumbnail images which > point to their associated images galleries. Also, I would like to organize > the images from left to right and top to bottom. Furthermore, I would likeThat looks like a perfect proposal for floated elements, no ? <div id="gallery"> <% for @image in @images do -%> <%= image_tag @image.path, :size => @image.size, :alt => @image.title %> <% end -%> </div> #gallery { width: 320px; /* 3 * 100px wide images + 10 px margins */ } #gallery img { float: left; margin: 10px; } Hope that helps ! -- Fran?ois Beausoleil http://blog.teksol.info/