Grouped Select in Rails
- by Neil Middleton
Simple question really - how do I use the select(ActionView::Helpers::FormOptionsHelper) with grouped options?
I have got it working with a select_tag (ActionView::Helpers::FormTagHelper) but I would really like to have it using a select tag to match the rest of the form. Is this possible?
My options look like this:
[
['Group 1', ["Item 1", "Item 2", "Item 3"]],
['Group 2',["Item 1", "Item 2", "Item 3", "Item 4"]]
]
whilst my view is currently:
%tr#expense
%td
= f.text_field :value
= f.hidden_field :type, :value => mode