[Rails] Re: to get multiple check_box values in controller

2009-03-06 Thread Darren Jeacocke
Is there a way to have this working while being able to use labels, and being valid HTML? Ie, unique IDs for the inputs? > no - you want the output to be > > type="checkbox" value="3" /> > > and then params[:user][:language_id] will be an array > > Fred -- Posted via http://www.ruby-forum.

[Rails] Re: to get multiple check_box values in controller

2008-09-17 Thread Frederick Cheung
On 17 Sep 2008, at 10:41, Sijo Kg wrote: > > Hi >Thanks for the reply I tried like > <% for language in @languages %> ><%= language.language %> <%= > check_box_tag("user[#{language.id}][]","#{language.id}") %> > <% end %> > And the source obtained is > English value="1" > /> > S

[Rails] Re: to get multiple check_box values in controller

2008-09-17 Thread Sijo Kg
Hi Thanks for the reply I tried like <% for language in @languages %> <%= language.language %> <%= check_box_tag("user[#{language.id}][]","#{language.id}") %> <% end %> And the source obtained is English Spanish Persian Is this correct?Then how can I access this in control

[Rails] Re: to get multiple check_box values in controller

2008-09-17 Thread Frederick Cheung
On Sep 17, 6:44 am, Sijo Kg <[EMAIL PROTECTED]> wrote: > Hi >     I have > > <%  for language in @languages %> >     <%= language.language %> <%= > check_box("user","language_id",{},checked_value = "1", unchecked_value = > "0") %> > <%  end %> You've got to use check_box_tag and not check_box,