Sorry for the newbie question in advance...  I've got three models, a
user, site and user_site model.  A site can have many users and a user
can have many sites.  The relationship between these two is stored in
user_site. In my model defs user and sites both have has_many
user_sites statement.  Within my user_sites file, there are two
belongs_to statements, one for user and one for site.  within the What
I'm looking to do is when a user is created initially to automatically
create a record in user_site for a default site (I have it contained
in an instance variable within the user controller).  What I'm not
sure is how to most effectively do this so that the generated id for
user is automatically pulled into the child record in user_site,
basically I'm trying to come up with an efficient method for creating
the user and user_site records.  Any guidance is much appreciated.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to