Thanks Heinz for the reply I fixed the problem by using
User Model: has_many :requests has_many :requesttargetusers has_many :targetrequests,:through=> :requesttargetusers,:source=>:request Request Model belongs_to :user has_many :requesttargetusers has_many :targetusers, :through=> :requesttargetusers, :source=>:user Requesttargetuser model: belongs_to :users belongs_to :requests And this worked for me... Heinz Strunk wrote: > I don't know if I got your question right but what if you just: > > User model: > has_and_belongs_to_many :requests > > Request model: > has_and_belongs_to_many :users > > and create a habtm table like: > create_table :users_requests, :id => false do |t| > t.integer :user_id > t.integer :request_id > end > > Now you can assign as many users for as many requests as you want and > vice versa. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

