hi,
I''m new to rails, and I have a problem. I have a habtm relationship
between Book and Author models. I''ve got the database, and it almost
works, except that I can''t destroy anything. When I try to destroy a
book or an author, either from the website or console, I get the
following error:
NameError: uninitialized constant Book::Authors
from ./script/../config/../config/../vendor/rails/activerecord/
lib/../../activesupport/lib/active_support/dependencies.rb:478:in
`const_missing''
from (eval):3:in `destroy_without_callbacks''
from ./script/../config/../config/../vendor/rails/activerecord/
lib/active_record/callbacks.rb:321:in `destroy_without_transactions''
from ./script/../config/../config/../vendor/rails/activerecord/
lib/active_record/transactions.rb:125:in `destroy''
from ./script/../config/../config/../vendor/rails/activerecord/
lib/active_record/connection_adapters/abstract/database_statements.rb:
59:in `transaction''
from ./script/../config/../config/../vendor/rails/activerecord/
lib/active_record/transactions.rb:95:in `transaction''
from ./script/../config/../config/../vendor/rails/activerecord/
lib/active_record/transactions.rb:121:in `transaction''
from ./script/../config/../config/../vendor/rails/activerecord/
lib/active_record/transactions.rb:125:in `destroy''
from (irb):3
I used scaffolding, I didn''t make any changes except migration files,
and I have no idea what seems to be the problem. Any ideas?
squil
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On 10/10/07, squil <squil0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > hi, > I''m new to rails, and I have a problem. I have a habtm relationship > between Book and Author models. I''ve got the database, and it almost > works, except that I can''t destroy anything. When I try to destroy a > book or an author, either from the website or console, I get the > following error: > > NameError: uninitialized constant Book::AuthorsJust a guess, but it looks like it''s looking for a model called Authors instead of Author, What are the model class names? What do your habtm declarations look like? -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---