Class: MatViews::Admin::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
AuthBridge
Defined in:
app/controllers/mat_views/admin/application_controller.rb

Overview

MatViews::Admin::ApplicationController


Base controller for the MatViews admin interface.

Responsibilities:

  • Provides authentication and authorization via MatViews::Admin::AuthBridge.

  • Applies the ‘mat_views/admin` layout 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 ‘mat_views_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 enforce `lang` consistency.

  • ‘around_action`: wraps requests in the browser’s time zone if valid.

Methods:

  • #default_url_options ensures ‘lang` param 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_id` param for frame-only actions.

  • #redirect_to_lang redirects when the URL ‘lang` param differs from `I18n.locale`.

  • #set_mat_views_locale sets the session-defined or default locale.

  • #mat_views_data_theme returns ‘light`, `dark`, or `nil` for theming.

Method Summary

Methods included from AuthBridge

#user