I''m trying to use :through to ''link'' to models, but
the << assignment
does not appear to work as I have it. Any help would be great :)
User model:
has_many :assignments
has_many :jobs, :through => :assignments
Jobs model:
has_many :assignments
has_many :users, :through => :assignments
Assignments:
belongs_to :job
belongs_to :user
This is what I am trying to do, but it does not work.
@user.jobs << @job
If I manually populate the assignments table with user and job id''s I
can do @jobs = @user.jobs etc.
--
Posted via http://www.ruby-forum.com/.