listing entries under corresponding date...

I have a rails app with view code long in need of an overhaul. Some
of the first app code I wrote was designed to display entires
belonging to a given date, under a date header derived from a model
timestamp field. For each day, I list the corresponding entries for
that day under the date as a header. Here's an example:

07/09/1976
--- Entry 1
--- Entry 2
--- Entry 3

07/08/1976
--- Entry 1
--- Entry 2

The results are in a @diary object which I loop through. I'd be happy
to post my code, which is ugly, though i wanted to find out if there
was a helper to do this, or if there's a technique that people use to
easily:

1. extract the date from a timestamp, and write it as a header
2. list all the corresponding entries for that day underneath it

...etc. etc.

Any techniques out there to use? ...or are there any helpers I might
not know about to make this work?

Thanks for your help in advance.

-A

Google for "group_by". Here's some examples.

http://weblog.rubyonrails.org/2006/3/1/new-in-rails-enumerable-group_by-and-array-in_groups_of
http://justbarebones.blogspot.com/2007/10/ruby-groupby.html

Awesome Phillip, this is very helpful, thanks.

-A