# Form - Tick boxes in related table

**URL:** <https://www.ruby-forum.com/t/form-tick-boxes-in-related-table/166062>\
**Category:** Rails\
**Created:** [April 21, 2009, 2:47pm UTC](https://www.ruby-forum.com/t/form-tick-boxes-in-related-table/166062 "2009-04-21T14:47:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikej](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@mikej](https://www.ruby-forum.com/u/mikej)\
**Post date:** [April 21, 2009, 2:47pm UTC](https://www.ruby-forum.com/t/form-tick-boxes-in-related-table/166062/1 "2009-04-21T14:47:47Z")

</div>

Sure this one is solved somewhere, but couldn’t find it.

I have a table which has a related table (has many through). I wish  
to choose 1 or more items in the related table with a check box. For  
example, if I had a table with group one, group two and group three  
and a list of clients. I would like to have a form so that given a  
client, (in the edit client form), I can assign a client to one or  
more groups.

How would I construct a form to achieve this using a reasonable  
succinct controller?

Many thanks,

Mike

---

<div class="post-metadata">

**Author:** ![mikej](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a9a28c/32.png) [@mikej](https://www.ruby-forum.com/u/mikej)\
**Post date:** [April 21, 2009, 2:53pm UTC](https://www.ruby-forum.com/t/form-tick-boxes-in-related-table/166062/2 "2009-04-21T14:53:06Z")

</div>

On Tue, Apr 21, 2009 at 2:46 PM, mikej [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> How would I construct a form to achieve this using a reasonable  
> succinct controller?
> 
> Many thanks,
> 
> Mike

Have a look at fields\_for which you can use for linked models

> **[ActionView::Helpers::FormHelper](https://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M001573)**
>
> Form helpers are designed to make working with resources much easier compared to using vanilla HTML.

There is also Nested Object Forms in Rails 2.3

> **[Ruby on Rails 2.3 Release Notes — Ruby on Rails Guides](https://guides.rubyonrails.org/2_3_release_notes.html#nested-object-forms)**
>
> Ruby on Rails 2.3 Release NotesRails 2.3 delivers a variety of new and improved features, including pervasive Rack integration, refreshed support for Rails Engines, nested transactions for Active Record, dynamic and default scopes, unified rendering,...

Andrew T.  
[http://ramblingsonrails.com](http://ramblingsonrails.com)  
[http://www.linkedin.com/in/andrewtimberlake](http://www.linkedin.com/in/andrewtimberlake)

“I have never let my schooling interfere with my education” - Mark Twain
