Module: Decidim::Surveys::SurveyHelper

Included in:
SurveysController
Defined in:
decidim-surveys/app/helpers/decidim/surveys/survey_helper.rb

Instance Method Summary collapse

Instance Method Details

#authorization_actionObject



18
19
20
# File 'decidim-surveys/app/helpers/decidim/surveys/survey_helper.rb', line 18

def authorization_action
  @authorization_action ||= params[:authorization_action]
end

#authorizationsObject



26
27
28
# File 'decidim-surveys/app/helpers/decidim/surveys/survey_helper.rb', line 26

def authorizations
  @authorizations ||= action_authorized_to(:answer, resource: questionnaire_for)
end

#authorize_action_path(handler_name) ⇒ Object



22
23
24
# File 'decidim-surveys/app/helpers/decidim/surveys/survey_helper.rb', line 22

def authorize_action_path(handler_name)
  authorizations.status_for(handler_name).current_path
end

#current_componentObject



14
15
16
# File 'decidim-surveys/app/helpers/decidim/surveys/survey_helper.rb', line 14

def current_component
  @current_component ||= Decidim::Component.find(params[:component_id])
end

#no_permissionObject



6
7
8
# File 'decidim-surveys/app/helpers/decidim/surveys/survey_helper.rb', line 6

def no_permission
  cell "decidim/authorization_modal", authorizations
end

#resourceObject



10
11
12
# File 'decidim-surveys/app/helpers/decidim/surveys/survey_helper.rb', line 10

def resource
  questionnaire_for
end