# Has\_many :through association

**URL:** <https://www.ruby-forum.com/t/has-many-through-association/157332>\
**Category:** Rails\
**Created:** [January 9, 2009, 3:44pm UTC](https://www.ruby-forum.com/t/has-many-through-association/157332 "2009-01-09T15:44:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![heldopslippers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@heldopslippers](https://www.ruby-forum.com/u/heldopslippers)\
**Post date:** [January 9, 2009, 3:44pm UTC](https://www.ruby-forum.com/t/has-many-through-association/157332/1 "2009-01-09T15:44:06Z")

</div>

Hee people,

I have the following problem:

I have the following tables:

groups:  
t.string :title

rights:  
t.integer :group\_id  
t.integer :menu\_id  
t.boolean :see  
t.boolean :edit

menus:  
t.string :title

when you create a group you should get a list of menu items where you  
can select if the persons in the group should be able to edit or see a  
particulary item.

Does anybody know how This would be possible (or point me in the right  
direction ? ).

Thanxs !

---

<div class="post-metadata">

**Author:** ![heldopslippers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@heldopslippers](https://www.ruby-forum.com/u/heldopslippers)\
**Post date:** [January 9, 2009, 3:52pm UTC](https://www.ruby-forum.com/t/has-many-through-association/157332/2 "2009-01-09T15:52:28Z")

</div>

To make it a bit more clear:  
in my form (for edit and new) I have the following:

\<% for menu in Menu.find(:all) %\>

 \<%= check\_box\_tag "group[menu\_ids][]", menu.id, @group.menus.include?(menu) %\> \<%= menu.title %\> \<% end %\>

But this is not for what i would like ! (if it is even possible 😛 )
