Class: Decidim::Assemblies::Admin::AssembliesSettingsController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- Decidim::Admin::ApplicationController
- ApplicationController
- Decidim::Assemblies::Admin::AssembliesSettingsController
- Defined in:
- decidim-assemblies/app/controllers/decidim/assemblies/admin/assemblies_settings_controller.rb
Overview
Controller used to manage the assemblies settings for the current organization.
Instance Method Summary collapse
-
#edit ⇒ Object
GET /admin/assemblies_settings/edit.
-
#update ⇒ Object
PUT /admin/assemblies_settings/:id.
Methods inherited from Decidim::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 RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#edit ⇒ Object
GET /admin/assemblies_settings/edit
12 13 14 15 |
# File 'decidim-assemblies/app/controllers/decidim/assemblies/admin/assemblies_settings_controller.rb', line 12 def edit :edit, :assemblies_setting, assemblies_settings: current_assemblies_settings @form = assemblies_settings_form.from_model(current_assemblies_settings) end |
#update ⇒ Object
PUT /admin/assemblies_settings/:id
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'decidim-assemblies/app/controllers/decidim/assemblies/admin/assemblies_settings_controller.rb', line 18 def update :update, :assemblies_setting, assemblies_settings: current_assemblies_settings @form = assemblies_settings_form .from_params(params, assemblies_settings: current_assemblies_settings) UpdateAssembliesSetting.call(current_assemblies_settings, @form) do on(:ok) do flash[:notice] = I18n.t("assemblies_settings.update.success", scope: "decidim.admin") redirect_to edit_assemblies_settings_path end on(:invalid) do flash.now[:alert] = I18n.t("assemblies_settings.update.error", scope: "decidim.admin") render :edit end end end |