Quick help needed by a novice

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 in

  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!