I've found useful to have a port of the Array#each_with_index
functionality to the already existent grouping methods (in_groups_of,
in_groups). That way we add the ability to iterate over an array in
groups and having an index for each group.
In case you think it's interesting I've created a couple of methods:
Array#with_index_in_groups_of / with_index_in_groups and sent a pull
request here: https://github.com/rails/rails/pull/556