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:
I want to find orders which contain product with an id = 3
I am doing it through a method
@product = Product.find(params[:id])
@orders = @product.orders
and then I have an rxml template to iterate over the orders and print
them onto the screen.