I am trying to generate the Form Select with the OPTGROUP tags, from a
simple array. For example I have an array : [Acer, laptop, 1], [Acer,
monitor, 2], [HP, desktop, 3], [HP, printer,4]
I know how to use the Select helper to generate the Select - Option
tags from an array. But I just couldn't figure out how to do with the
I would like to produce the final result from the array as:
<option value="3" >Desktop</option>
I know there is a helper called
option_groups_from_collection_for_select. But from what I understand
this helper is only based on the object relationships of its
arguments. I would like to generate from a simple array, using a
I have spend hours trying to figure this out but without success. Any
help will be greatly appreciated.
Thanks in advance.