Class: Decidim::Elections::FeedbacksController

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

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