Class: Decidim::Surveys::Admin::SurveysController

Inherits:
ApplicationController show all
Includes:
Forms::Admin::Concerns::HasQuestionnaire, Forms::Admin::Concerns::HasQuestionnaireAnswers
Defined in:
decidim-surveys/app/controllers/decidim/surveys/admin/surveys_controller.rb

Overview

This controller allows the user to update a Page.

Instance Method Summary collapse

Methods inherited from Admin::Components::BaseController

#current_component, #current_participatory_space, #parent_path, #permission_class_chain, #permission_scope, #permissions_context, #skip_manage_component_permission

Methods included from RegistersPermissions

register_permissions

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 NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#edit_questionnaire_titleObject


25
26
27
# File 'decidim-surveys/app/controllers/decidim/surveys/admin/surveys_controller.rb', line 25

def edit_questionnaire_title
  t(:title, scope: "decidim.forms.admin.questionnaires.form", questionnaire_for: translated_attribute(current_component.name))
end

#public_urlObject

Specify the public url from which the survey can be viewed and answered


16
17
18
# File 'decidim-surveys/app/controllers/decidim/surveys/admin/surveys_controller.rb', line 16

def public_url
  Decidim::EngineRouter.main_proxy(current_component).survey_path(survey)
end

#questionnaire_forObject


11
12
13
# File 'decidim-surveys/app/controllers/decidim/surveys/admin/surveys_controller.rb', line 11

def questionnaire_for
  survey
end

#questionnaire_participant_answers_url(session_token) ⇒ Object

Specify where to redirect after exporting a user response


21
22
23
# File 'decidim-surveys/app/controllers/decidim/surveys/admin/surveys_controller.rb', line 21

def questionnaire_participant_answers_url(session_token)
  Decidim::EngineRouter.admin_proxy(survey.component).show_survey_path(session_token: session_token)
end