Tonkatsufan
2007-Nov-21 09:41 UTC
How do I put a date column from a collection as a header for a XHTML Table?
Hi, what''s the best way to achieve this. Say I have a data collection ordered by a date column (ASC or DESC) like this one. Date;Name;Amount ---------------------------- 20071001;John;500 20071001;Jim;400 20070902;Bob;300 20070901;Ron;700 Now, I want to output an XHTML Table which groups the records by date, effectively rendering a table row with only the date as a headline: Name - Amount ===============October 01, 2007 -------------------------------- John - 500 Jim - 400 -------------------------------- September 02, 2007 -------------------------------- Bob - 300 -------------------------------- September 01, 2007 -------------------------------- Ron - 700 ...etc. As this snippet will repeat itself, I would like to come up with a helper which I send the collection to, and the date column to make headers from, and get the above output back. Some hints in the right direction would be highly appreciated. Thanks a lot, Manuel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---