Re: [Rails] Re: Invalid associated child object is silently not auto-saved and does not make saving of parent fa

2012-01-25 Thread Peter Vandenabeele
On Wed, Jan 25, 2012 at 1:15 PM, Peter Vandenabeele wrote: > On Wed, Jan 25, 2012 at 11:31 AM, Bala TS wrote: > >> Hai! >> >> One-to-one >> >> use has_one in the base, and belongs_to in the associated model. >> >> class Parent < ActiveRecord::Base >> has_one :child >> end >> >> class Child < Act

Re: [Rails] Re: Invalid associated child object is silently not auto-saved and does not make saving of parent fa

2012-01-25 Thread Peter Vandenabeele
On Wed, Jan 25, 2012 at 11:31 AM, Bala TS wrote: > Hai! > > One-to-one > > use has_one in the base, and belongs_to in the associated model. > > class Parent < ActiveRecord::Base > has_one :child > end > > class Child < ActiveRecord::Base > belongs_to :parent# foreign key - parent_id > end >

[Rails] Re: Invalid associated child object is silently not auto-saved and does not make saving of parent fa

2012-01-25 Thread Bala TS
Hai! One-to-one use has_one in the base, and belongs_to in the associated model. class Parent < ActiveRecord::Base has_one :child end class Child < ActiveRecord::Base belongs_to :parent# foreign key - parent_id end Try this way: Bye:) Bdeveloper01 -- Posted via http://www.ruby-forum