Forum: Ruby on Rails Quick help needed by a novice

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
D167461db018fb93fa36587b3def84cf?d=identicon&s=25 Andreas Kviby (Guest)
on 2007-07-17 08:16
(Received via mailing list)
I have done this so far...

First of all I installed Active Scaffold

1. Created a model for a table named products (modelname: product)
2. Run rake db_migrate so I have a nice table with a bunch of fields
3. Created a model for a table named categories (modelname :category)
4. Now I want a small tiby and nice looking subform on my create new
product  page where my client can choose to which category this product
belongs to.
5. So I create a migration to add a table for the relations to be stored
6. So I open up the model file and write for product.rb
  has_many :products_categories
  has_many :categories, :through => :products_categories
7. And I open up the category.rb file and adds
belongs_to_and_has_many :products
8. Nothing works! Please help me!

Andreas Kviby
Telefon 070-352 66 76
This topic is locked and can not be replied to.