Newbie issue, probably:
Have two tables:
Each order has one or more origin and destination locations. (The
order is an order for a transportation company to ship something
Each location can exist on multiple orders.
Have the following link tables:
class Order < ActiveRecord::Base
has_and_belongs_to_many :origin_location, :class_name => 'Location', :join_table => 'order_origin_location_link', :foreign_key => 'order_id', :association_foreign_key => 'location_id' has_and_belongs_to_many :destination_location, :class_name => 'Location', :join_table => 'order_destination_location_link', :foreign_key => 'order_id', :association_foreign_key => 'location_id' def add_stop end
When I invoke order#edit, I get
undefined method `address1’ for Location:Class
Can anyone illuminate me where I have gone astray?