many-to-many. add an entry in the auxiliary table. ROR3.

I'm newbie in ROR.

I need to create many-to-many.
There are 2 models:
-product (product)
-category (categor)

To connect them i make the third model - prodcat (prod_id,cat_id).

In Product controller:

def create
   @product =[:product])
   respond_to do |format|
   params[:prodcat].each do |cat|
     fl.puts pms
       format.html { redirect_to(@product,
       :notice => 'Product was successfully created.') }
       format.xml { render :xml => @product, :status => :created,
       :location => @product }
       format.html { render :action => "new" }
       format.xml { render :xml => @product.errors,
         :status => :unprocessable_entity }

After creation new product there are new records in database, but they
are empty:

AREL (1.3ms) INSERT INTO "prodcats" ("prod_id", "cat_id",
"created_at","updated_at") VALUES (NULL, NULL,
'2010-10-14 15:07:14.203159', 2010-10-14 15:07:14.203159')
AREL (1.1ms) INSERT INTO "prodcats" ("prod_id", "cat_id",
"created_at", "updated_at") VALUES (NULL, NULL,
'2010-10-14 15:07:14.228977', '2010-10-14 15:07:14.228977')

But /home/bla-bla-bla/out isn't empty and has data, that must be in

{"prod_id"=>9, "cat_id"=>"1"}
{"prod_id"=>9, "cat_id"=>"2"}
{"prod_id"=>9, "cat_id"=>"3"}
{"prod_id"=>9, "cat_id"=>"4"}

Where is my mistake?