Class: ActiveElement::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
ActionView::Helpers::TagHelper, DefaultControllerActions
Defined in:
app/controllers/active_element/application_controller.rb

Overview

Base controller for all ActiveElement API admin front ends, provides standard layout, menu, authentication as Superuser, and standardised HTML widgets.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from DefaultControllerActions

#create, #destroy, #edit, #index, #new, #show, #update

Class Method Details

.active_elementObject



12
13
14
# File 'app/controllers/active_element/application_controller.rb', line 12

def self.active_element
  @active_element ||= ActiveElement::ControllerInterface.new(self)
end

.active_element_editable_fields(*args) ⇒ Object



16
17
18
# File 'app/controllers/active_element/application_controller.rb', line 16

def self.active_element_editable_fields(*args)
  @active_element_assigned_editable_fields = args
end

Instance Method Details

#_active_element_text_searchObject



36
37
38
# File 'app/controllers/active_element/application_controller.rb', line 36

def _active_element_text_search
  render(**ActiveElement::Components::TextSearch::Component.new(controller: self).response)
end

#active_elementObject



20
21
22
# File 'app/controllers/active_element/application_controller.rb', line 20

def active_element
  @active_element ||= ActiveElement::ControllerInterface.new(self.class, self)
end

#render_active_element_hook(hook, locals: {}) ⇒ Object



30
31
32
33
34
# File 'app/controllers/active_element/application_controller.rb', line 30

def render_active_element_hook(hook, locals: {})
  render_to_string partial: hook, locals: locals
rescue ActionView::MissingTemplate
  nil
end