Class: Decidim::Surveys::SurveysController

Inherits:
ApplicationController show all
Includes:
ComponentPathHelper, Forms::Concerns::HasQuestionnaire, SurveyHelper
Defined in:
app/controllers/decidim/surveys/surveys_controller.rb

Overview

Exposes the survey resource so users can view and answer them.

Instance Method Summary collapse

Methods included from SurveyHelper

#authorization_action, #authorizations, #authorize_action_path, #current_component, #no_permission, #resource

Instance Method Details

#check_permissionsObject



17
18
19
# File 'app/controllers/decidim/surveys/surveys_controller.rb', line 17

def check_permissions
  render :no_permission unless action_authorized_to(:answer, resource: survey).ok?
end

#questionnaire_forObject



21
22
23
# File 'app/controllers/decidim/surveys/surveys_controller.rb', line 21

def questionnaire_for
  survey
end