2010-01-06 27 views

回答

2

好了,你@products进入视图实际上是在您的控制器动作(ProductsController /controllers/products_controller.rb)中定义的,您必须在您的'SecondController'的动作中定义@products

您可以先查看索引或显示动作ProductsController,并检查一些tu torials或书籍。

1

您需要在行动来定义它,你正在使用

如果你想使用它/存储/ an_action,添加控制器:

def an_action 
    @products = Product.all # for instance 
end 
相关问题