ruby-on-railsrefinerycmsrefinery

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. Also, I have a Accommodation model that is nested in the Congress route like this:

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?


Solution

  • 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.