Class: Decidim::Demographics::Admin::QuestionsController

Inherits:
ApplicationController
  • Object
show all
Includes:
Forms::Admin::Concerns::HasQuestionnaire, Forms::Admin::Concerns::HasQuestionnaireResponsesUrlHelper
Defined in:
app/controllers/decidim/demographics/admin/questions_controller.rb

Instance Method Summary collapse

Instance Method Details

#after_update_urlObject



12
# File 'app/controllers/decidim/demographics/admin/questions_controller.rb', line 12

def after_update_url = edit_questions_questions_path

#edit_questionnaire_titleObject



29
# File 'app/controllers/decidim/demographics/admin/questions_controller.rb', line 29

def edit_questionnaire_title = t(:title, scope: "decidim.demographics.admin.questions.edit")

#edit_questions_templateObject



10
# File 'app/controllers/decidim/demographics/admin/questions_controller.rb', line 10

def edit_questions_template = "decidim/demographics/admin/questions/edit"

#questionnaireObject



20
21
22
23
24
25
# File 'app/controllers/decidim/demographics/admin/questions_controller.rb', line 20

def questionnaire
  @questionnaire ||= Decidim::Forms::Questionnaire.where(questionnaire_for:).first_or_initialize
  @questionnaire.override_edit!
  Decidim::Demographics.create_default_questionnaire!(@questionnaire)
  @questionnaire
end

#questionnaire_forObject



27
# File 'app/controllers/decidim/demographics/admin/questions_controller.rb', line 27

def questionnaire_for = demographic

#questionnaire_participants_urlObject



14
# File 'app/controllers/decidim/demographics/admin/questions_controller.rb', line 14

def questionnaire_participants_url = decidim_admin_demographics.responses_path

#response_options_url(_params) ⇒ Object



18
# File 'app/controllers/decidim/demographics/admin/questions_controller.rb', line 18

def response_options_url(_params) = decidim_admin_demographics.responses_path

#update_urlObject



16
# File 'app/controllers/decidim/demographics/admin/questions_controller.rb', line 16

def update_url = update_questions_questions_path