Class: Decidim::Challenges::Admin::SurveyFormController

Inherits:
ApplicationController
  • Object
show all
Includes:
Forms::Admin::Concerns::HasQuestionnaire, Forms::Admin::Concerns::HasQuestionnaireAnswers
Defined in:
app/controllers/decidim/challenges/admin/survey_form_controller.rb

Overview

This controller allows an admin to manage the form to be filled when an user answer a survey

Instance Method Summary collapse

Instance Method Details

#after_update_urlObject



31
32
33
# File 'app/controllers/decidim/challenges/admin/survey_form_controller.rb', line 31

def after_update_url
  edit_challenge_surveys_path(challenge_id: challenge.id)
end

#answer_options_url(params) ⇒ Object



23
24
25
# File 'app/controllers/decidim/challenges/admin/survey_form_controller.rb', line 23

def answer_options_url(params)
  answer_options_challenge_survey_path(**params)
end

#public_urlObject



15
16
17
# File 'app/controllers/decidim/challenges/admin/survey_form_controller.rb', line 15

def public_url
  Decidim::EngineRouter.main_proxy(current_component).answer_challenge_survey_path(challenge)
end

#questionnaire_forObject



11
12
13
# File 'app/controllers/decidim/challenges/admin/survey_form_controller.rb', line 11

def questionnaire_for
  challenge
end

#questionnaire_participants_urlObject



19
20
21
# File 'app/controllers/decidim/challenges/admin/survey_form_controller.rb', line 19

def questionnaire_participants_url
  index_answers_challenge_surveys_path(challenge_id: challenge.id)
end

#update_urlObject



27
28
29
# File 'app/controllers/decidim/challenges/admin/survey_form_controller.rb', line 27

def update_url
  challenge_surveys_form_path(challenge_id: challenge.id)
end