Grouping in tables

I have an app which uses ActiveResource to get data from a non-Rails client. One of the things it has to do is display that data in a webpage, with subtotals by week. What's an easy way to break up a collection of ARes instances by a column so I can then pump each group into a partial. The partial then displays the lines for that group, and a sub-total at the end.

The other way I could do it is to xml-ise the ARes records, generate the table, with groups and subtotals using XSLT, and then feed that as text into a render method. But that involves stepping outside Rails to format stuff.

Anyone have any ideas?

Thanks

John Small