How to send an array with the ids of selected elements from my view?
I have a hidden input
= f.hidden_field :selected_items
You have to explicitly mention that the hidden-field is taking multiple values, you can do this in multiple ways,
You should declare the hidden-field as an array.
f.hidden_field "selected_items" f.hidden_field :selected_items, :multiple => true
Append every select box selected value, into the hiddenfield using jquery,
$('#selected_items').val($('#selected_items').val() +','+ selected_item);
Send the values comma-separated and the params will send an array from the hiddenfield.