23 Jul 08:20
Re: cannot figure out how to handle multi checkbox
From: Dejan Dimic <dejan.dimic@...>
Subject: Re: cannot figure out how to handle multi checkbox
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-23 06:20:48 GMT
Subject: Re: cannot figure out how to handle multi checkbox
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-23 06:20:48 GMT
take a look at http://railscasts.com/episodes/17 On Jul 23, 8:13 am, Naija Guy <rails-mailing-l...@...> wrote: > I have a checkbox that is not tied to a model. Basically, here's what > the beginning looks like in the view: > > <% for entrant in @entrants %> > <tr class="<%= cycle("even", "odd") %>" > > <td><%= check_box ("to_check", entrant.firstname, {}, > checked = "false") %></td> > > This submits to a controller action that has only the following line: > > @firstnames = params[:to_check] > > I'm trying to display the results on the next page: > > <% for firstname in @firstnames %> > <br /> > <%=h firstname %> > > <% end %> > > This seems really simple. Right now it's displaying every firstname in > the array whether it was checked or not. I tried another way and it > only returned the first element in the array (so the names overwrote > each other). How do I check in the controller action method to see > which ones were checked? I'm coming from a Java web background and am a(Continue reading)
RSS Feed