# Handling checkbox in rails?

**URL:** <https://www.ruby-forum.com/t/handling-checkbox-in-rails/148025>\
**Category:** Rails\
**Created:** [September 8, 2008, 1:20pm UTC](https://www.ruby-forum.com/t/handling-checkbox-in-rails/148025 "2008-09-08T13:20:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin\_mercy2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Post date:** [September 8, 2008, 1:20pm UTC](https://www.ruby-forum.com/t/handling-checkbox-in-rails/148025/1 "2008-09-08T13:20:55Z")

</div>

Dear all,

I have a doubt in using checkbox in my task?

I have used four check box for selecting multiple options while adding a  
new record. Like,

```
    <%= check_box("upload", :selected => @selected) %>
    <%= check_box("download", :selected => @selected) %>
    <%= check_box("rename", :selected => @selected) %>
    <%= check_box("delete", :selected => @selected) %>

```

So i have got four check box to select upload, download, rename, delete.

If suppose i have selected upload and download option and added to DB.  
its working fine. While listing the records also its working fine but  
while modifying the record the upload and download fields are not shown  
in the view as selected.

Could anyone please suggest about the methods to perform the modifying  
option in case of check box.

Thanks in advance

Regards,  
Jose Martin

---

<div class="post-metadata">

**Author:** ![martin\_mercy2001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d2c977/32.png) [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Post date:** [September 8, 2008, 1:48pm UTC](https://www.ruby-forum.com/t/handling-checkbox-in-rails/148025/2 "2008-09-08T13:48:21Z")

</div>

On 8 Sep 2008, at 12:20, dare ruby wrote:

> ```
> <%= check_box("download", :selected => @selected) %>
> <%= check_box("rename", :selected => @selected) %>
> <%= check_box("delete", :selected => @selected) %>
> 
> ```
> 
> So i have got four check box to select upload, download, rename,  
> delete.

If you check the api docs for check\_box you’ll see that’s not all the  
parameters it’s expecting

Fred
