# Quick help needed by a novice

**URL:** <https://www.ruby-forum.com/t/quick-help-needed-by-a-novice/109603>\
**Category:** Rails\
**Created:** [July 17, 2007, 8:16am UTC](https://www.ruby-forum.com/t/quick-help-needed-by-a-novice/109603 "2007-07-17T08:16:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas\_Kviby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ad7895/32.png) [@Andreas\_Kviby](https://www.ruby-forum.com/u/Andreas_Kviby)\
**Post date:** [July 17, 2007, 8:16am UTC](https://www.ruby-forum.com/t/quick-help-needed-by-a-novice/109603/1 "2007-07-17T08:16:00Z")

</div>

Hi  
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!

## –

Andreas Kviby  
Telefon 070-352 66 76  
E-post removed\_email\_address@domain.invalid
