Forum: Ruby on Rails Ruby Interface Recommendations Photo Gallery Creation?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (Guest)
on 2006-02-25 03:14
(Received via mailing list)
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
8e44c65ac5b896da534ef2440121c953?d=identicon&s=25 Ezra Zygmuntowicz (Guest)
on 2006-02-25 06:16
(Received via mailing list)
On Feb 24, 2006, at 6:14 PM, Conrad Taylor wrote:

> me in regards to limiting the number of items on a page and
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> 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
3dd4b52a0946bd698b1d1635a46ea3a3?d=identicon&s=25 Francois Beausoleil (Guest)
on 2006-02-27 02:42
(Received via mailing list)
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 like

That 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 !
This topic is locked and can not be replied to.