Module: TemplateSwitcher::ActionControllerExtension

Extended by:
ActiveSupport::Concern
Defined in:
lib/template_switcher/action_controller_extension.rb

Instance Method Summary collapse

Instance Method Details

#render_switcher(selector, *args) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/template_switcher/action_controller_extension.rb', line 9

def render_switcher(selector, *args)
  TemplateSwitcher.mapping ||= {}

  if mapping = TemplateSwitcher.mapping[selector]
    prepend_view_path(Rails.root.join("app", mapping))
  end
  __render__(*args)
end