Why is the first element always blank in my Rails multi-select, using an embedded array?

后端 未结 9 2373
我寻月下人不归
我寻月下人不归 2020-11-29 19:54

I\'m using Rails 3.2.0.rc2. I\'ve got a Model, in which I have a static Array which I\'m offering up through a form such that users may se

9条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 20:21

    In Rails 4+ set :include_hidden on select_tag to false

    <%= form.grouped_collection_select :employee_id, Company.all, :employees, :name, :id, :name, { include_hidden: false }, { size: 6, multiple: true } %>
    

提交回复
热议问题