From d1f4c83adfde031abf240ec619b2662fa36041e7 Mon Sep 17 00:00:00 2001 From: Brice Sanchez Date: Wed, 25 Jul 2018 22:49:01 -0400 Subject: [PATCH] Partial revert ae30517a68e2d1b9116ef684e523272cb9cfc6f6 : Remove layout def, we use render_with_templates? method It was a bad idea, it breaks the preview layout. render_with_templates? will use the default layout 'application' or the @page.layout_template --- .../controllers/refinery/pages/admin/preview_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pages/app/controllers/refinery/pages/admin/preview_controller.rb b/pages/app/controllers/refinery/pages/admin/preview_controller.rb index c7211ed49a..0f768681a3 100644 --- a/pages/app/controllers/refinery/pages/admin/preview_controller.rb +++ b/pages/app/controllers/refinery/pages/admin/preview_controller.rb @@ -10,6 +10,8 @@ class PreviewController < Refinery::PagesController skip_before_action :error_404, :set_canonical + layout :layout + def show render_with_templates? end @@ -44,6 +46,10 @@ def permitted_page_params :layout_template, :custom_slug, parts_attributes: [:id, :title, :slug, :body, :position] ] end + + def layout + 'application' + end end end end