Pål Bergström wrote:
I have a controller and model for both "products" and "baskets". I've
set up the belongs_to and has_many. When I'm in a third controller
"shop" I get an error when I try to get the "products" data via
"baskets". So asking for item.product.price gives an error.
Can I have this kind of relation when I'm in a third controller, that
doesn't have a model itself?
Controllers have nothing to do with models, although best practices
suggests having a controller per model.
A controller has visibility into all your models if it needs to..
Please show us your relations that you wrote in your models and the
controller code used to access them and then we may be better prepared
to assist you