How to send an array with the ids of selected elements from my view? I have a hidden input
= f.hidden_field :selected_items
I can do this when the item is only one with jquery. When clicking on it I take its id and put it in the hidden input's value. However, I do not know how to process clicking on items with id 1,4,7 and 9 and then send it to my controller as :selected_items = [1,4,7,9] for example. Thank you!