Displaying 1 result from an estimated 1 matches for "my_bar".
Did you mean:
m_bar
2006 Apr 04
1
Manipulating has_many :through associations
...rs, :through => :foo_bars
class bar
has_many :foo_bars
has_many :foos, :through => :foo_bars
class foo_bars
belongs_to :foo
belongs_to :bar
If I have an instance of foo and an instance of bar, how do I add the
association between the two of them?
my_foo.bars << my_bar
or (inversely),
my_bar.foos << my_foo
or do I somehow need to manipulate the join model explicitly?
Thanks,
Brad
--
Bradley Mazurek