Rails checkbox and options

I use a lot of checkboxes on the page as below:

<%= check_box_tag(:one, value = 1) %></p> 

Imagine that it goes from 1 to 20, anyway when changing the value. How can I get those that have been checked in the params controller?

Example: if the user checks 3, 5 and 10, how can I get only these parameters in one parameter?

+4
source share
1 answer

You will already receive only those that have been checked; unverified fields are not sent to the server.

+5
source

All Articles