select_tag('letters', options_for_select(['A','B','C','D'], 'A'), :size => 5, :multiple => true)
You need to add the to the name to get back an array of selected values.
select_tag('letters', options_for_select(['A','B','C','D'], 'A'), :size => 5, :multiple => true)
You need to add the to the name to get back an array of selected values.
That works great! Thanks!! But what if I need to display the form with more then one value already selected? I tried
select_tag('letters', options_for_select(['A','B','C','D'],'A','B'), :size =>5, :multiple => true)
but that raised the following error: "Wrong number of arguments (3 for 2)".
Any suggestions?