I have a collection of records in my database that I want to print out to separate tables based on the record date.
So I already have the following (in Haml, fyi):
%table
%tr
%th Name
%th Type
%th Total Hits
- for record in @records
%tr{ :class => cycle('odd','even') }
%td= record.name
%td= record.target_type
%td= record.outbound + record.detail + record.custom + record.dynamic
At the moment, it displays all my records in the same table. record.recorded_on
contains the date for my records. I want to generate separate tables, like the one above, for each day that contains all the records for that day.
How would I do this?