Has anyone ever had problems with :through relationship? I have set it properly, according to the book, but getting response from the browser
"Could not find the association :line_items in model Product"
and the relationship set in Product model is: has_many :orders, :through => :line_items
Order model looks like: has_many :line_items
and LineItem belongs_to :product belongs_to :order
I want to find orders which contain product with an id = 3 I am doing it through a method
def who_bought @product = Product.find(params[:id]) @orders = @product.orders end
and then I have an rxml template to iterate over the orders and print them onto the screen. Help please!