Re: [Rails] Building Assocation with multiple belong_tos

2012-12-12 Thread Jarod Watkins
Ah thanks Colin, that was it! On Wed, Dec 12, 2012 at 10:28 AM, Colin Law wrote: > On 12 December 2012 15:18, Jarod Watkins wrote: > > Hello, > > I have two models that look like the following: > > > > ModelA: > > attr_accessible :date, ... > > has_many :modelb > > That should be modelbs,

Re: [Rails] Building Assocation with multiple belong_tos

2012-12-12 Thread Colin Law
On 12 December 2012 15:18, Jarod Watkins wrote: > Hello, > I have two models that look like the following: > > ModelA: > attr_accessible :date, ... > has_many :modelb That should be modelbs, plural. > accepts_nested_attributes_for :modelb > end > > ModelB: > attr_accessible :date, ... >

[Rails] Building Assocation with multiple belong_tos

2012-12-12 Thread Jarod Watkins
Hello, I have two models that look like the following: ModelA: attr_accessible :date, ... has_many :modelb accepts_nested_attributes_for :modelb end ModelB: attr_accessible :date, ... belongs_to :modela, :modelc, :modeld end And then in ModelAs controller: @modela = Modela.new 3.time