Ruby on Rails 4 - simple_form multiple select input

后端 未结 3 961
臣服心动
臣服心动 2020-12-16 11:10

I have a simple_form input field that looks like this:

<%= f.input :particular_users, collection: @all_users, input_html: { class: \'multiselectuser\', mu         


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-16 11:33

    It actually does work the way I wanted it to. The trick is to tell the strong parameters to allow a hash. It doesn't throw a strong parameters error, the param just gets thrown out and doesn't come through. So I set it to for example: params.require(:survey).permit(:particular_users => []).

提交回复
热议问题