Class: Decidim::Surveys::SurveysController

Inherits:
ApplicationController show all
Includes:
ComponentPathHelper, Forms::Concerns::HasQuestionnaire
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

Instance Method Details

#check_permissionsObject



15
16
17
# File 'app/controllers/decidim/surveys/surveys_controller.rb', line 15

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

#form_pathObject



23
24
25
# File 'app/controllers/decidim/surveys/surveys_controller.rb', line 23

def form_path
  main_component_path(current_component)
end

#questionnaire_forObject



19
20
21
# File 'app/controllers/decidim/surveys/surveys_controller.rb', line 19

def questionnaire_for
  survey
end