【问题标题】:refinerycms 'admin' tried to access 'refinery/admin/accommodations' but was rejectedrefinerycms 'admin' 试图访问 'refinery/admin/accommodations' 但被拒绝
【发布时间】:2016-04-28 17:09:26
【问题描述】:

在我的炼油厂扩展中,我有一个 Congress 模型,它是扩展的“主要”模型。另外,我有一个像这样嵌套在 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

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

【问题讨论】:

    标签: ruby-on-rails refinerycms refinery


    【解决方案1】:

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

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

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

    至少它对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-02
      • 2021-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多