[英]refinerycms 'admin' tried to access 'refinery/admin/accommodations' but was rejected
In my refinery extension I have a Congress model that is the "main" model of the extension. 在我的炼油厂扩展中,我有一个Congress模型,它是扩展的“主要”模型。 Also, I have a Accommodation model that is nested in the Congress route like this: 另外,我在国会路线中嵌套了一个Accommodation模型,如下所示:
namespace :admin do
resources :congresses do
resources :accommodations
as_routes
end
end
When I try to create a new Accommodation by its new action I get: 当我尝试通过其新动作创建新的住宿时,我得到:
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
Anybody have an idea of what is happening? 有人知道发生了什么吗? The Accommodation new action is called on the Congress views, is this relevant? 根据国会的观点呼吁“适应新行动”,这是否相关?
Ok I've found the solution to my problem in here . 好的,我在这里找到了解决我问题的方法。 Basically in these situations you have to add a line like this: 基本上在这些情况下,您必须添加如下代码:
plugin.menu_match = /(admin|refinery)\/(congresses|accommodations)$/
to your "parent" model engine file, so that you can access the nested model controller. 到“父”模型引擎文件中,以便您可以访问嵌套的模型控制器。
At least it worked for me. 至少对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.