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.
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 %>
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
That looks like a perfect proposal for floated elements, no ?
<% for @image in @images do -%>
<%= image_tag @image.path, :size => @image.size, :alt => @image.title
%>
<% end -%>