From: Peter Bunyan Date: 2007-12-07T16:55:24+09:00 Subject: Re: help with has_and_belongs_to_many Junkone wrote: > class Trade < ActiveRecord::Base > > has_and_belongs_to_many :tags > > class Tag < ActiveRecord::Base > set_table_name "tags" > has_and_belongs_to_many :trades > > end > > how to i add records to the table tags_trades using active rcord. i > dont have a model for tags_trades becaues the docs states that i > dont need one. > > thanks in advance. Well, first off, you forgot to end the Trade class. And you forgot to give it a table name. Once you've done that, and you've created your instance of the Trade class (let's call it trade, just to be simple...) and a bunch of Tag classes with silly names: trade.tags = [cheese, timeshare, lubricant] -- Posted via http://www.ruby-forum.com/.