0

我正在尝试使用多选下拉菜单,但我无法弄清楚它为什么不起作用。

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

它没有给我任何错误,添加multiple => true也没有任何区别。

4

1 回答 1

1

多个是 html_options 并且选中的是辅助选项。Select 有下一个语法 select(object, method, Choices, options = {}, html_options = {})

所以,写

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

阅读有关选择的更多信息

于 2013-07-31T19:50:28.810 回答