Forum: Ruby on Rails has_many :through association

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5aaa92336b530d04b32d1aa5da4280ee?d=identicon&s=25 Held Opslippers (heldopslippers)
on 2009-01-09 15:44
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 !
5aaa92336b530d04b32d1aa5da4280ee?d=identicon&s=25 Held Opslippers (heldopslippers)
on 2009-01-09 15:52
To make it a bit more clear:
in my form (for edit and new) I have the following:

<% for menu in Menu.find(:all) %>
  <tr>
    <td><%= check_box_tag "group[menu_ids][]", menu.id,
@group.menus.include?(menu) %></td>
     <td><%= menu.title %></td>
  </tr>
<% end %>

But this is not for what i would like ! (if it is even possible :P )
This topic is locked and can not be replied to.