[Rails] Re: How to deal with this code ?

2009-09-09 Thread Frederick Cheung
On Sep 9, 8:19 am, Pascal Friederich wrote: > On Sep 9, 3:33 am, fireflyman wrote: > > > So,Could you help me deal with my code ? > > David already gave you the answer, you are trying to add a > has_many :through associated record to an unsaved record. The error > message is pretty much tellin

[Rails] Re: How to deal with this code ?

2009-09-09 Thread Pascal Friederich
On Sep 9, 3:33 am, fireflyman wrote: > So,Could you help me deal with my code ? David already gave you the answer, you are trying to add a has_many :through associated record to an unsaved record. The error message is pretty much telling you that "Cannot associate new records through 'Book#autho

[Rails] Re: How to deal with this code ?

2009-09-08 Thread fireflyman
So,Could you help me deal with my code ? On Tue, Sep 8, 2009 at 9:46 PM, Frederick Cheung wrote: > > > On 8 Sep 2009, at 13:44, David A. B > > > >> ~~~ > >> When I run my test,and goes wrong .Like this---> > >> @

[Rails] Re: How to deal with this code ?

2009-09-08 Thread Frederick Cheung
On 8 Sep 2009, at 13:44, David A. B > >> ~~~ >> When I run my test,and goes wrong .Like this---> >> @@@ >> 1) Error: >> test_ferret(BookTest): >> ActiveRecord::HasManyThroughCantAssociateNewRecords: Cannot ass

[Rails] Re: How to deal with this code ?

2009-09-08 Thread David A. Black
Hi -- On Mon, 7 Sep 2009, fireflyman wrote: > > Hi,everyone > Here is my model code---> > > has_many :authors_books > has_many :authors, :through => :authors_books > > belongs_to :book > belongs_to :author > > has_many

[Rails] Re: How to deal with this code ?

2009-09-08 Thread Aldric Giacomoni
fireflyman wrote: > Hi,everyone > Here is my model code---> > > has_many :authors_books > has_many :authors, :through => :authors_books > > belongs_to :book > belongs_to :author > > has_many :authors_books > ha