diff --git a/app/controllers/concerns/lookbook/preview_controller_actions.rb b/app/controllers/concerns/lookbook/preview_controller_actions.rb index a134cf19..9dcf1798 100644 --- a/app/controllers/concerns/lookbook/preview_controller_actions.rb +++ b/app/controllers/concerns/lookbook/preview_controller_actions.rb @@ -8,7 +8,7 @@ module PreviewControllerActions before_action :assign_preview, only: :lookbook_render_scenario before_action :assign_scenario, only: :lookbook_render_scenario - around_action :set_locale, only: :lookbook_render_scenario + around_action :lookbook_set_locale, only: :lookbook_render_scenario content_security_policy(false) if respond_to?(:content_security_policy) @@ -42,7 +42,7 @@ def lookbook_render_template(template, assigns, opts = {}) prepend_preview_scenarios_view_path with_action_view_settings do - html = render_to_string(template, assigns: assigns, **determine_layout(opts[:layout])) + html = render_to_string(template, assigns: assigns, **lookbook_determine_layout(opts[:layout])) html += opts[:append_html] render html: html end @@ -50,11 +50,11 @@ def lookbook_render_template(template, assigns, opts = {}) private - def set_locale(&block) + def lookbook_set_locale(&block) I18n.with_locale(params[:locale] || I18n.default_locale, &block) end - def determine_layout(layout_override = nil) + def lookbook_determine_layout(layout_override = nil) return {} unless defined?(Rails.root) layout_declaration = {}