Hi,
I am new to Rails. I am trying to stablish many to many relationship
between Books and Categories.
Following are the Models.
---
class Book ActiveRecord::Base
has_many :book_categories
has_many :categories, :through = :book_categories
end
---
class Category ActiveRecord::Base
I'm not an expert and I try a long shot. Have you set the foreign keys
(1 to many to BookCategories from both Book and Categories), when you
created the tables by the migrations?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Following is the schema of the tables. ActiveRecord automatically
automatically maps them using the category_id and book_id present
in intermediate table book_categories.
Any idea why i am getting the error, ArgumentError: A copy of
Category has been removed from the module
tree but is still
shouldn't the BookCategories class be called BookCategory?
eric.
On Jun 18, 9:43 am, ibnesayeed [EMAIL PROTECTED] wrote:
Following is the schema of the tables. ActiveRecord automatically
automatically maps them using the category_id and book_id present
in intermediate table book_categories.