Class: Decidim::Elections::FeedbacksController

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

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 '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 '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 'app/controllers/decidim/elections/feedbacks_controller.rb', line 17

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