Class: Decidim::Admin::Components::BaseController

Inherits:
ApplicationController show all
Includes:
ParticipatorySpaceAdminContext, Settings
Defined in:
app/controllers/decidim/admin/components/base_controller.rb

Overview

This controller is the abstract class from which all component controllers in their admin engines should inherit from.

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_ability_klass, #user_not_authorized_path

Instance Method Details

#current_componentObject



31
32
33
# File 'app/controllers/decidim/admin/components/base_controller.rb', line 31

def current_component
  request.env["decidim.current_component"]
end

#current_participatory_spaceObject



35
36
37
# File 'app/controllers/decidim/admin/components/base_controller.rb', line 35

def current_participatory_space
  current_component.participatory_space
end

#parent_pathObject



39
40
41
# File 'app/controllers/decidim/admin/components/base_controller.rb', line 39

def parent_path
  @parent_path ||= EngineRouter.admin_proxy(current_participatory_space).components_path
end