1
在我的应用程序,我有张控制器,型号名称是表,但我的路线是如下惨惨的load_and_authorize_resource当资源名称是从模型/控制器名称不同
routes.rb
namespace :magazine do
resources :pages, :controller => "sheets" do
resources :articles do
resources :comments
使URL会杂志/页/ 1/article ...
在我的文章控制器中,如何调用表单的load_and_authorize_resource以便我可以访问相关工作表的文章。 我试图
load_and_authorize_resource :sheet, :class => 'Sheet', :parent => false
load_and_authorize_resource :through => :sheet
无法访问@ sheet.articles ......
还是一样..... load_and_authorize_resource:板材,:类=>' Sheet',:parent => false load_and_authorize_resource:through =>:sheet不起作用 – Oatmeal 2013-04-11 09:01:51
为什么你需要'parent'? – apneadiving 2013-04-11 09:08:25
在哪个控制器中,你是否想要数据? – apneadiving 2013-04-11 09:09:43