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

Inherits:
ApplicationController show all
Includes:
Forms::Admin::Concerns::HasQuestionnaire
Defined in:
decidim-templates/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, #template_types

Methods inherited from Admin::ApplicationController

#permission_class_chain, #permission_scope, #user_has_no_permission_path, #user_not_authorized_path

Methods included from HttpCachingDisabler

#disable_http_caching

Methods included from NeedsSnippets

#snippets

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#after_update_urlObject


21
22
23
# File 'decidim-templates/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 'decidim-templates/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 'decidim-templates/app/controllers/decidim/templates/admin/questionnaire_templates/questionnaires_controller.rb', line 25

def public_url
  nil
end

#questionnaire_forObject


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

def questionnaire_for
  template
end

#update_urlObject


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

def update_url
  questionnaire_path(template)
end