> Here's what I got right now: http://pastie.org/652718.
> The problem is that I don't really know how to diplay all months in
> the table header without creating another grouping by
> ['created_on_month'].
>
Your code assumes that each user will have entries for the same months?
If that's the case, grabbing the keys from the first subgroup hash
should work?
You could also just:
@months = @table.map {|r| r['created_on_month'] }.sort.uniq
If I'm missing something you'll have to explain to me a bit further!
> Additionally I'd like to print total activity across these months -
> sum of all "subgroups.data.size" for each user i.e. in the second
> column (the first column is user name).
>
Not sure about the difficulty here, don't try to be super-efficient,
just iterate over the data as normal using inject(0). You could also use
the add_column method earlier on @table to calculate it.
Not sure if either of those answers help!
Regards,
Andrew