Class: Decidim::Elections::FeedbacksController

Inherits:
ApplicationController show all
Includes:
HasVoteFlow, Forms::Concerns::HasQuestionnaire
Defined in:
decidim-elections/app/controllers/decidim/elections/feedbacks_controller.rb

Overview

This controller allows a user to give feedback once finished voting

Instance Method Summary collapse

Methods included from HasVoteFlow

#ballot_questions, #can_preview?, #default_vote_flow, #preview_mode?, #vote_flow

Methods inherited from Components::BaseController

#current_component, #current_manifest, #current_participatory_space, #permission_class_chain, #permission_scope, #redirect_unless_feature_private, #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 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

#after_answer_pathObject

Overwrites the 'after_answer_path' that gets passed to 'redirect_to' after answering the questionnaire. By default it redirects to the questionnaire_for.


23
24
25
26
27
28
29
# File 'decidim-elections/app/controllers/decidim/elections/feedbacks_controller.rb', line 23

def after_answer_path
  if current_user.nil?
    election_path(election, onboarding: true)
  else
    election_path(election)
  end
end

#questionnaire_forObject


12
13
14
# File 'decidim-elections/app/controllers/decidim/elections/feedbacks_controller.rb', line 12

def questionnaire_for
  election
end

#update_urlObject

where the questionnaire will be submitted.


17
18
19
# File 'decidim-elections/app/controllers/decidim/elections/feedbacks_controller.rb', line 17

def update_url
  answer_election_feedback_path(election, hash: params[:hash], token: params[:token])
end