Class: Smriti::Admin::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Smriti::Admin::ApplicationController
- Includes:
- AuthBridge
- Defined in:
- app/controllers/smriti/admin/application_controller.rb
Overview
Smriti::Admin::ApplicationController
Base controller for the Smriti admin interface.
Responsibilities:
- Provides authentication and authorization via Smriti::Admin::AuthBridge.
- Applies the
smriti/adminlayout and includes UI helpers. - Manages locale (
I18n.locale) and enforces language parameter consistency. - Sets the browser time zone around each request when provided via cookies.
- Exposes
smriti_data_theme(light/dark) for theming via cookies. - Provides frame helpers (
render_frame,ensure_frame) to support Turbo-driven admin UI navigation.
Filters:
before_action: sets locale and redirects to enforcelangconsistency.around_action: wraps requests in the browser’s time zone if valid.
Methods:
- #default_url_options ensures
langparam is included in generated URLs. - #set_time_zone runs the request in the cookie-provided time zone if valid.
- #render_frame renders a UI frame partial given
frame_id. - #ensure_frame requires a
frame_idparam for frame-only actions. - #redirect_to_lang redirects when the URL
langparam differs fromI18n.locale. - #set_smriti_locale sets the session-defined or default locale.
- #smriti_data_theme returns
light,dark, ornilfor theming.
Direct Known Subclasses
DashboardController, MatViewDefinitionsController, MatViewRunsController, PreferencesController