Class: Decidim::Surveys::Admin::SurveysController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- Admin::ApplicationController
- Admin::Components::BaseController
- ApplicationController
- Decidim::Surveys::Admin::SurveysController
- 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
- #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.
Methods inherited from Admin::Components::BaseController
#current_component, #current_participatory_space, #parent_path, #permission_class_chain, #permission_scope, #permissions_context, #set_component_breadcrumb_item, #skip_manage_component_permission
Methods included from RegistersPermissions
Methods inherited from Admin::ApplicationController
#permission_class_chain, #permission_scope, #user_has_no_permission_path, #user_not_authorized_path
Methods included from Headers::HttpCachingDisabler
Methods included from NeedsSnippets
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#edit ⇒ Object
11 12 13 14 15 |
# File 'decidim-surveys/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 'decidim-surveys/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 'decidim-surveys/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 'decidim-surveys/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 'decidim-surveys/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 |