0

在我的炼油厂扩展中,我有一个国会模型,它是扩展的“主要”模型。另外,我有一个嵌套在 Congress 路线中的住宿模型,如下所示:

namespace :admin do
  resources :congresses do
    resources :accommodations
    as_routes       
  end
end

当我尝试通过其新操作创建新住宿时,我得到:

Processing by Refinery::Admin::AccommodationsController#new as HTML 
'admin' tried to access 'refinery/admin/accommodations' but was rejected.
 Filter chain halted as :restrict_controller rendered or redirected

有人知道发生了什么吗?住宿新行动呼吁国会意见,这有关系吗?

4

1 回答 1

0

好的,我在这里找到了我的问题的解决方案。基本上在这些情况下,您必须添加这样的一行:

plugin.menu_match = /(admin|refinery)\/(congresses|accommodations)$/

到您的“父”模型引擎文件,以便您可以访问嵌套模型控制器。

至少它对我有用。

于 2016-04-29T16:29:45.180 回答