Class: Decidim::Features::BaseController

Inherits:
ApplicationController show all
Includes:
ActionAuthorization, ParticipatorySpaceContext, Settings
Defined in:
app/controllers/decidim/features/base_controller.rb

Overview

Controller from which all feature engines inherit from. It’s in charge of setting the appropiate layout, including necessary helpers, and overall fooling the engine into thinking it’s isolated.

Instance Method Summary collapse

Methods included from ActionAuthorization

#_action_authorizer, #action_authorization, #authorize_action!, #authorize_action_path

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#ability_contextObject



48
49
50
51
52
53
54
# File 'app/controllers/decidim/features/base_controller.rb', line 48

def ability_context
  super.merge(
    current_manifest: current_manifest,
    current_settings: current_settings,
    feature_settings: feature_settings
  )
end

#current_featureObject



40
41
42
# File 'app/controllers/decidim/features/base_controller.rb', line 40

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

#current_manifestObject



44
45
46
# File 'app/controllers/decidim/features/base_controller.rb', line 44

def current_manifest
  @current_manifest ||= current_feature.manifest
end

#current_participatory_spaceObject



36
37
38
# File 'app/controllers/decidim/features/base_controller.rb', line 36

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