Class: Decidim::Features::BaseController

Inherits:
ApplicationController show all
Includes:
Decidim::FeatureSettings, NeedsParticipatoryProcess
Defined in:
lib/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 inherited from ApplicationController

#user_not_authorized_path

Instance Method Details

#ability_contextObject



37
38
39
40
41
42
43
44
# File 'lib/decidim/features/base_controller.rb', line 37

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

#current_featureObject



25
26
27
# File 'lib/decidim/features/base_controller.rb', line 25

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

#current_manifestObject



29
30
31
# File 'lib/decidim/features/base_controller.rb', line 29

def current_manifest
  current_feature.manifest
end

#current_participatory_processObject



33
34
35
# File 'lib/decidim/features/base_controller.rb', line 33

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