Ruby Interface Recommendations Photo Gallery Creation?


#1

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


#2

On Feb 24, 2006, at 6:14 PM, Conrad T. wrote:

me in regards to limiting the number of items on a page and


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

Conrad-

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


#3

Hello Conrad,

2006/2/24, Conrad T. removed_email_address@domain.invalid:

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 -%>

#gallery { width: 320px; /* 3 * 100px wide images + 10 px margins */ }
#gallery img { float: left; margin: 10px; }

Hope that helps !