Create a select tag with some options grouped and others not grouped
- by dontangg
I'm using Rails 3. I want to create a select tag with some options grouped and others not grouped. Options would look something like this:
Income
Auto
Fuel
Maintenance
Home
Maintenance
Mortgage
In this example, Income is not a group, but Auto and Home are.
I see three helper methods grouped_options_for_select and grouped_collection_select, option_groups_from_collection_for_select.
Is there a way to use a helper to do this or will I have to generate the HTML myself? I imagine I could use two different helpers to create the options and just append the results of both.