Class: Decidim::Surveys::Admin::SurveysController
- Inherits:
-
ApplicationController
- Object
- Admin::Components::BaseController
- ApplicationController
- Decidim::Surveys::Admin::SurveysController
- 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
- #edit ⇒ Object
- #edit_questionnaire_title ⇒ Object
-
#public_url ⇒ Object
Specify the public url from which the survey can be viewed and answered.
- #questionnaire_for ⇒ Object
-
#questionnaire_participant_answers_url(session_token) ⇒ Object
Specify where to redirect after exporting a user response.
Instance Method Details
#edit ⇒ Object
11 12 13 14 15 |
# File 'app/controllers/decidim/surveys/admin/surveys_controller.rb', line 11 def edit (:update, :questionnaire, questionnaire:) @form = form(Decidim::Forms::Admin::QuestionnaireForm).from_model(questionnaire) end |
#edit_questionnaire_title ⇒ Object
31 32 33 |
# File 'app/controllers/decidim/surveys/admin/surveys_controller.rb', line 31 def edit_questionnaire_title t(:title, scope: "decidim.forms.admin.questionnaires.form", questionnaire_for: translated_attribute(current_component.name)) end |
#public_url ⇒ Object
Specify the public url from which the survey can be viewed and answered
22 23 24 |
# File 'app/controllers/decidim/surveys/admin/surveys_controller.rb', line 22 def public_url Decidim::EngineRouter.main_proxy(current_component).survey_path(survey) end |
#questionnaire_for ⇒ Object
17 18 19 |
# File 'app/controllers/decidim/surveys/admin/surveys_controller.rb', line 17 def questionnaire_for survey end |
#questionnaire_participant_answers_url(session_token) ⇒ Object
Specify where to redirect after exporting a user response
27 28 29 |
# File 'app/controllers/decidim/surveys/admin/surveys_controller.rb', line 27 def questionnaire_participant_answers_url(session_token) Decidim::EngineRouter.admin_proxy(survey.component).show_survey_path(session_token:) end |