Module: CamaleonCms::RequestContextConcern

Extended by:
ActiveSupport::Concern
Includes:
SiteHelper
Included in:
CamaleonController
Defined in:
app/controllers/concerns/camaleon_cms/request_context_concern.rb

Overview

Wires per-request site/theme resolution and Camaleon's before-action housekeeping into the runtime controller stack. The current_site / current_theme implementations live in CamaleonCms::SiteHelper (single source of truth shared with views); this concern only adds controller-only hooks like view-path setup and site-existence guards.

Instance Method Summary collapse

Methods included from SiteHelper

#cama_current_site_host_port, #cama_get_list_layouts_files, #cama_get_list_template_files, #cama_is_test_request?, #current_locale, #current_theme, #site_after_install, #site_install_theme, #site_uninstall_theme

Instance Method Details

#current_site(site = nil) ⇒ Object

Back-compat: expose the resolved site as the @current_site controller ivar for legacy templates/plugins. The helper logic itself stays ivar-free (it reads/writes CurrentRequest.site); only this controller concern bridges the value into an instance variable so views/plugins keep working.



16
17
18
19
20
# File 'app/controllers/concerns/camaleon_cms/request_context_concern.rb', line 16

def current_site(site = nil)
  result = super
  @current_site = CurrentRequest.site
  result
end