diff --git a/app/controllers/concerns/alchemy/page_redirects.rb b/app/controllers/concerns/alchemy/page_redirects.rb index d9b4f6add5..32a3b1eeaa 100644 --- a/app/controllers/concerns/alchemy/page_redirects.rb +++ b/app/controllers/concerns/alchemy/page_redirects.rb @@ -49,7 +49,7 @@ def public_child_redirect_url end def controller_and_action_url - return unless @page.has_controller? + return unless @page.definition['controller'] main_app.url_for(@page.controller_and_action) end diff --git a/app/models/alchemy/page/page_natures.rb b/app/models/alchemy/page/page_natures.rb index 8f796104d7..9e361028e8 100644 --- a/app/models/alchemy/page/page_natures.rb +++ b/app/models/alchemy/page/page_natures.rb @@ -74,7 +74,7 @@ def locked? # @deprecated Please use a menu node with an url pointing to your controller path instead. def controller_and_action - if has_controller? + if definition['controller'] { controller: definition["controller"].gsub(/(^\b)/, "/#{$1}"), action: definition["action"] diff --git a/spec/models/alchemy/page_spec.rb b/spec/models/alchemy/page_spec.rb index 16ba87e02f..528fedf85d 100644 --- a/spec/models/alchemy/page_spec.rb +++ b/spec/models/alchemy/page_spec.rb @@ -2211,7 +2211,6 @@ module Alchemy context 'if the page has a custom controller defined in its definition' do before do - allow(page).to receive(:has_controller?).and_return(true) allow(page).to receive(:definition).and_return({'controller' => 'comments', 'action' => 'index'}) end it "should return a Hash with controller and action key-value pairs" do