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

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

Overview

This controller allows the user to update a Page.

Instance Method Summary collapse

Instance Method Details

#edit_questionnaire_titleObject



25
26
27
# File '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 '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 '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 '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