vendredi 22 juin 2018

Set default value with grouped_options_for_select , using f.select

I have a grouped drop down menu rendered by the following,

      = f.select :location_id, grouped_options_for_select(grouped_location_options, default_location_name), { selected: default_location_name }, class: 'form-control'

I would like to have the default value to be Unassigned, but the above code doesn't seem to be doing what I'd like.

Could someone give me some clues to solve this??

Many thanks in advance!

Aucun commentaire:

Enregistrer un commentaire