I have MyModel with two attributes, a :label string and an :group integer which groups these strings. The labels for these groups come from an array of strings GROUP_LABELS. For my html view, I wanted to create a select control with grouped options.
The resulting hash of nested arrays needs to be:
{ 'Group Label 1': [[ 'Label 1.1', 1 ],[ 'Label 1.2', 2 ]],
'Group Label 2': [[ 'Label 2.1', 3 ],[ 'Label 2.2', 3 ] ... ]}