From: Michael Campbell Date: 2005-06-09T12:43:46+09:00 Subject: Re: How to neatly handle multiple checkboxes with Rails On 4/29/05, Gavin Kistner wrote: > On Apr 26, 2005, at 1:54 PM, Edgardo Hames wrote: > > In case this solution is way too far from being done, how can I handle > > checking and unchecking the different authors in that table on the > > Controller side? What I would need to do is remove the unchecked > > authors and add the checked ones. [...] How do you all usually solve > > this problem? > > The functionality of checkboxes is the same as that of a > multiple-select field, though the UI is different. Quite a bit, yeah. Gavin, I'm old, so go slow, but you've completely lost me. If I iterate over a check_box tag (using a render_partial_collection), what I get is something like: foo bar baz blurfle ... but if I select multiple, params has only 1, due to the same key in each one: @params => {object => {method => 2}} (or 3, or 4, or 10, but never more than one of those) How do I structure the checkbox tag (or can I?) so that I can end up with some indication that (ex.) both "foo" and "bar" were checked?