I have a simple_form input field that looks like this:
<%= f.input :particular_users, collection: @all_users, input_html: { class: \'multiselectuser\', mu
f.input :days, collection: @your_collection, input_html: { multiple: true }
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 => []).
To create multiple select tags with simple_form
, use:
<%= f.association :particular_users, collection: @all_users, input_html: { class: 'multiselectuser'} %>
see part Associations
in the gem description.
But as you don't want to use an ActiveRecord associaion, use select_tag
:
<%= select_tag 'particular_users',
options_from_collection_for_select(@all_users, :id, :name),
multiple: true, class: 'multiselectuser' %>