Class: Decidim::Demographics::DemographicsController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- ApplicationController
- Decidim::Demographics::DemographicsController
- Includes:
- Forms::Concerns::HasQuestionnaire, UserProfile
- Defined in:
- decidim-demographics/app/controllers/decidim/demographics/demographics_controller.rb
Instance Method Summary collapse
Methods included from UserProfile
#available_verification_workflows
Methods inherited from ApplicationController
Methods inherited from ApplicationController
Methods included from UserBlockedChecker
#check_user_block_status, #check_user_not_blocked
Methods included from NeedsSnippets
Methods included from Headers::HttpCachingDisabler
Methods included from HasStoredPath
#skip_store_location?, #store_current_location
Methods included from TranslatableAttributes
#attachment?, #default_locale?
Methods included from RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#destroy ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'decidim-demographics/app/controllers/decidim/demographics/demographics_controller.rb', line 19 def destroy DeleteDemographicData.call(questionnaire, current_user) do on(:ok) do flash[:notice] = I18n.t("destroy.success", scope: "decidim.demographics") redirect_to demographics_engine.demographics_path end on(:invalid) do flash.now[:alert] = I18n.t("destroy.error", scope: "decidim.demographics") redirect_to demographics_engine.demographics_path end end end |
#show ⇒ Object
11 12 13 14 15 16 17 |
# File 'decidim-demographics/app/controllers/decidim/demographics/demographics_controller.rb', line 11 def show @form = form(Decidim::Forms::QuestionnaireForm).from_model(questionnaire) @form.add_responses!(questionnaire:, session_token:, ip_hash:) @form.allow_editing_responses = true render template: end |
#template ⇒ Object
33 34 35 |
# File 'decidim-demographics/app/controllers/decidim/demographics/demographics_controller.rb', line 33 def template "decidim/demographics/demographics/show" end |