Skip to content

Commit

Permalink
Prefix names of all controller actions
Browse files Browse the repository at this point in the history
  • Loading branch information
allmarkedup committed Oct 24, 2024
1 parent 1d3256a commit ce70f1a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -42,19 +42,19 @@ 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
end

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 = {}
Expand Down

0 comments on commit ce70f1a

Please sign in to comment.