diff --git a/app/controllers/spina/pages_controller.rb b/app/controllers/spina/pages_controller.rb index f57a0b5e1..f7184edca 100644 --- a/app/controllers/spina/pages_controller.rb +++ b/app/controllers/spina/pages_controller.rb @@ -27,7 +27,7 @@ def rewrite_page end def page - @page ||= (action_name == 'homepage') ? Page.find_by(name: 'homepage') : Page.find_by(materialized_path: "/" + params[:id]) + @page ||= (action_name == 'homepage') ? Page.find_by!(name: 'homepage') : Page.find_by!(materialized_path: "/" + params[:id]) end helper_method :page