Hi everyone,
I'm trying to group contents that belong on a same date together for display, such that the date only gets posted once and in chronological order.
Something like:
14th October 2009
Item 3
Item 3 content
Item 2
Item 2 content
13th October 2009
Item 1
Item 3 content
How can I display that in view? (Assume that @items is being passed from the controller, which contains all the items)
I've tried group_by, but I can't get it to work as it seems to be arranging itself by the value of the day itself rather than together with the month.
The code in question: http://github.com/davidchua/Political-Watch/blob/master/app/views/items/index.html.erb
To see the problem in a live deployment, its at http://political-watch.org