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.
A6be7720d668f4f02160b600e67337e2?d=identicon&s=25 Ivan Medda (Guest)
on 2006-03-24 18: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?
7cda78d70ab775710f6fa24e0a5b68db?d=identicon&s=25 Emin Hasanov (Guest)
on 2006-03-24 20: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.