Class: Decidim::Templates::Admin::QuestionnaireTemplates::QuestionnairesController

Inherits:
ApplicationController
  • Object
show all
Includes:
Forms::Admin::Concerns::HasQuestionnaire
Defined in:
app/controllers/decidim/templates/admin/questionnaire_templates/questionnaires_controller.rb

Overview

This controller allows an admin to manage a questionnaire form for a questionnaire_template

Instance Method Summary collapse

Methods inherited from ApplicationController

#permission_class_chain

Instance Method Details

#after_update_urlObject



21
22
23
# File 'app/controllers/decidim/templates/admin/questionnaire_templates/questionnaires_controller.rb', line 21

def after_update_url
  edit_questionnaire_template_path(id: template.id)
end

#edit_questionnaire_titleObject



29
30
31
# File 'app/controllers/decidim/templates/admin/questionnaire_templates/questionnaires_controller.rb', line 29

def edit_questionnaire_title
  t(:title, scope: "decidim.templates.admin.questionnaire_templates.form", questionnaire_for: translated_attribute(template.name))
end

#public_urlObject



25
26
27
# File 'app/controllers/decidim/templates/admin/questionnaire_templates/questionnaires_controller.rb', line 25

def public_url
  nil
end

#questionnaire_forObject



13
14
15
# File 'app/controllers/decidim/templates/admin/questionnaire_templates/questionnaires_controller.rb', line 13

def questionnaire_for
  template
end

#update_urlObject



17
18
19
# File 'app/controllers/decidim/templates/admin/questionnaire_templates/questionnaires_controller.rb', line 17

def update_url
  questionnaire_path(template)
end