im trying to do a gallery type layout with paginator. Im fairly new to ruby and have no idea how to do this. basically i want a table with 5 cols and 5 rows to display my images. Has any one done this lately and can post some pseudocode? Thanks Sam _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
rails has a paginator built in. You can use the code I posted on the other list to do this. Josh On 8/30/05, Sam Mayes <codeslave-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > im trying to do a gallery type layout with paginator. Im fairly new to ruby > and have no idea how to do this. basically i want a table with 5 cols and 5 > rows to display my images. Has any one done this lately and can post some > pseudocode? > > > Thanks > > Sam > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
hi josh, which list would that be? I googled the archives but haven''t found your post... I''m using paginator already, but would like to see how to resolve columns in a simple way. thanks oliver On Aug 31, 2005, at 5:05 PM, Josh Charles wrote:> rails has a paginator built in. You can use the code I posted on the > other list to do this. > > Josh > > On 8/30/05, Sam Mayes <codeslave-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> >> im trying to do a gallery type layout with paginator. Im fairly >> new to ruby >> and have no idea how to do this. basically i want a table with 5 >> cols and 5 >> rows to display my images. Has any one done this lately and can >> post some >> pseudocode? >> >> >> Thanks >> >> Sam >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> >> > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Here is how i did it 5x5 gallery view <table> <tr> <th>Company</th> </tr> <% counter = 0 %> <% 5.times do %> <tr> <% 5.times do %> <% if @systems[counter] %> <td> <table> <tr> <td><%= @systems[counter].company.name %></td> <td><%= @systems[counter].model %></td> <td><%= @systems[counter].sid %></td> <td><%= @systems[counter].sm_img %></td> </tr> <% for price in @systems[counter].prices %> <tr> <td><%= price.price %></td> <td><%= price.store_name %></td> <td colspan="2"></td> </tr> <% end %> </table> </td> <% else %> <td></td> <% end %> <% counter+=1 %> <% end %> </tr> <% end %> </table> On 9/21/05, oliver barnes <ol1barn3s-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > hi josh, > which list would that be? I googled the archives but haven''t found > your post... > I''m using paginator already, but would like to see how to resolve > columns in a simple way. > > thanks > oliver > > On Aug 31, 2005, at 5:05 PM, Josh Charles wrote: > > > rails has a paginator built in. You can use the code I posted on the > > other list to do this. > > > > Josh > > > > On 8/30/05, Sam Mayes <codeslave-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > >> > >> > >> im trying to do a gallery type layout with paginator. Im fairly > >> new to ruby > >> and have no idea how to do this. basically i want a table with 5 > >> cols and 5 > >> rows to display my images. Has any one done this lately and can > >> post some > >> pseudocode? > >> > >> > >> Thanks > >> > >> Sam > >> > >> _______________________________________________ > >> Rails mailing list > >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > >> > >> > >> > >> > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 9/21/05, oliver barnes <ol1barn3s-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi josh, > which list would that be? I googled the archives but haven''t found > your post... > I''m using paginator already, but would like to see how to resolve > columns in a simple way. > > thanks > oliverThat was a long time ago, it seems. I don''t have this code anymore, I''m sorry. It was posted to either this list or the ruby list, though, so it''s in there somewhere. I know it didn''t take but a few minutes to write, though, so if you are still having problems, let me know, and I can send you either a general algorithm, or the ruby code. Josh