Forum: Ruby on Rails check_box_tag

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ivan M. (Guest)
on 2006-03-24 19:45

What's the right way to use the CHECK_BOX_TAG?

I used:

<% for @pippo in @model %>
<%= check_box_tag (:scelta,@pippo) %>
<% end %>

How Can I control if a person choosen the second or third element of the
vector @pippo?
Emin H. (Guest)
on 2006-03-24 21:28
(Received via mailing list)
You need to use this form

<%= check_box_tag('scelta[]', @pippo) %>

then in controller you can access params[:scelta] as collection which
can iterate through and do the required checks
This topic is locked and can not be replied to.