Sha256: f5d90e80b2df71d54e9f624afa8e0c8f3e841c9b7d2b5e69bbacf12e3e939032
Contents?: true
Size: 1.2 KB
Versions: 9
Compression:
Stored size: 1.2 KB
Contents
# frozen_string_literal: true module ActiveElement # Base controller for all ActiveElement API admin front ends, provides standard layout, menu, # authentication as Superuser, and standardised HTML widgets. class ApplicationController < ActionController::Base include ActionView::Helpers::TagHelper include ActiveElement::DefaultControllerActions layout 'active_element' def self.active_element @active_element ||= ActiveElement::ControllerInterface.new(self) end def self.active_element_editable_fields(*args) @active_element_assigned_editable_fields = args end def active_element @active_element ||= ActiveElement::ControllerInterface.new(self.class, self) end before_action -> { active_element.authenticate } before_action -> { ActiveElement::ControllerAction.new(self).process_action } helper_method :active_element helper_method :render_active_element_hook def render_active_element_hook(hook) render_to_string partial: hook rescue ActionView::MissingTemplate nil end def _active_element_text_search render(**ActiveElement::Components::TextSearch::Component.new(controller: self).response) end end end
Version data entries
9 entries across 9 versions & 1 rubygems