Hai friends,
I hav two models related with habtm

class User < ActiveRecord::Base
  has_and_belongs_to_many :station,
                          :join_table => "stations_users",
                          :foreign_key => "user_id",
                          :association_foreign_key => "station_id"

class Station < ActiveRecord::Base
  has_and_belongs_to_many :user
end

When i create a new user its user_id and the station _id is not inserted
into the "stations_users" table.I hav used scaffolding 4 creating these
two models.How can i insert the fields for the join table also when a
user is created?
Can any one help me?


Thanks and regards,
Veena
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to