Class: Decidim::Surveys::SurveysController

Inherits:
ApplicationController show all
Includes:
ComponentPathHelper, Forms::Concerns::HasQuestionnaire, SurveyHelper
Defined in:
decidim-surveys/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

Methods included from ComponentPathHelper

#can_be_managed?, #main_component_path, #main_component_url, #manage_component_path

Methods inherited from Components::BaseController

#current_component, #current_manifest, #current_participatory_space, #permission_class_chain, #permission_scope, #redirect_unless_feature_private, #set_component_breadcrumb_item, #share_token

Methods included from RegistersPermissions

register_permissions

Methods included from UserBlockedChecker

#check_user_block_status, #check_user_not_blocked

Methods included from NeedsSnippets

#snippets

Methods included from Headers::HttpCachingDisabler

#disable_http_caching

Methods included from HasStoredPath

#skip_store_location?, #store_current_location

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#check_permissionsObject



17
18
19
# File 'decidim-surveys/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 'decidim-surveys/app/controllers/decidim/surveys/surveys_controller.rb', line 21

def questionnaire_for
  survey
end