You may want to check out this blog post. I think it may help with
what you are looking to do:
http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/
On Dec 22, 8:59 pm, "Simon Macneall"
<macne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi all,
>
> I have a Message class which has_many Message_Users, Message_User is
> basically a join table with an attribute, and belongs_to a User.
>
> so it kinda looks like the following:
>
> Message has_many :message_users
>
> MessageUser belong_to :user
>
> User - lots of user stuff
>
> What I want to do, is on the Message create screen have a list box with
> all the users in it, and when the Message is created have it automagically
> create 1 MessageUser for each user selected, and link them to the new
> Message through the MessageUser association. Is this possible, or do I
> need to grab the list of users selected and manually create the structures?
> Or can anyone see a better way to set up the structures?
>
> Hope the question is clear.
> Cheers
> Simon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---