ruby on rails - Why is my multiple-select with selected not working? -


i trying use multiple-selection drop-down unable figure out why not working.

<%= select( map1[:field_name], "id", map1[:field_codes], :multiple => "true", :selected => optionval[value] )%> 

it not give me error, , adding multiple => true not make difference.

multiple html_options , selected 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" } )%> 

read more select


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -