If I have a loop, let''s say: <% for user in @users %> <tr> <td><%= link_to "#{user.his_uid}", :action => ''show'', :id => user %></td> <td><%= link_to "#{user.his_uid}", :action => ''show'', :id => user %></td> </tr> <% end %> How can I get the second #{user.his_uid} to be the second object in the list? Is there a method for this (object.next) or a special way of making two columns tables? Thanks in advance, LP --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 4, 2007 1:48 PM, lpgauth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <lpgauth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > If I have a loop, let''s say: > > <% for user in @users %> > <tr> > <td><%= link_to "#{user.his_uid}", :action => ''show'', :id => user > %></td> > <td><%= link_to "#{user.his_uid}", :action => ''show'', :id => user > %></td> > </tr> > <% end %> > > How can I get the second #{user.his_uid} to be the second object in > the list? Is there a method for this (object.next) or a special way of > making two columns tables?Have a look at in_groups_of: http://api.rubyonrails.com/classes/ActiveSupport/CoreExtensions/Array/Grouping.html -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Are you after something like this? <tr> <% for user in @users %> <td><%= link_to user.his_uid, :action => ''show'', :id => user %></td> <% end %> </tr> -- Ryan Bigg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you Greg! Exactly what I needed. On Dec 4, 6:38 pm, Ryan <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Are you after something like this? > <tr> > <% for user in @users %> > <td><%= link_to user.his_uid, :action => ''show'', :id => user %></td> > <% end %> > </tr> > > -- > Ryan Bigg--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---