> Thanks, this solves the problem with months and I just found out about
> the problem you mentioned :)
> The code assumes that each user will have entries for every month,
> which is not the case, so iterating over sub groups to display the
> table doesn't really work that well.
> So what's the possible solution?
> On Oct 13, 1:41 pm, Andrew France <andrew+li...@avito.co.uk> wrote:
> > Hi Szimek,
> > > 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