UPDATE
Got it to work by using has_and_belongs_to_many
Anyone know why this works ?
Hi,
I get the following error when saving with active record
undefined method `reflect_on_association' for Class:Class
my relationships look like this :
class Contact < ActiveRecord::Base
has_many :classes
has_many :sessions, :through => :classes
end
class Class < ActiveRecord::Base
belongs_to :session
belongs_to :contact
end
class Session < ActiveRecord::Base
has_many :classes
has_many :contacts, :through => :classes
end
My request looks like this
{"commit"=>"Submit", "contact"=>{"address"=>"", "postcode"=>"", "notes"=>"", "session_ids"=>"2", "phone"=>"", "last_name"=>"w", "email"=>"", "first_name"=>"w"}}
The session_id and contact_id should be saved in the class model
Thanks
Alex