Reputation: 1433
I am trying to use a multiple-selection drop-down but I am unable to figure out why it is not working.
<%= select( map1[:field_name], "id", map1[:field_codes], :multiple => "true", :selected => optionVal[value] )%>
It does not give me any error, and adding multiple => true
does not make any difference.
Upvotes: 0
Views: 1086
Reputation: 614
Multiple is html_options and selected is helper option. Select has next syntax select(object, method, choices, options = {}, html_options = {})
So, write
<%= select( map1[:field_name], "id", map1[:field_codes], { :selected => optionVal[value] }, { :multiple => "true" } )%>
Upvotes: 1