Class: Decidim::NotificationsSettingsController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- Decidim::NotificationsSettingsController
- Includes:
- UserProfile
- Defined in:
- app/controllers/decidim/notifications_settings_controller.rb
Overview
The controller to handle the user’s notifications settings page.
Instance Method Summary collapse
Methods included from UserProfile
#available_verification_workflows
Methods included from UserGroups
Methods included from UserBlockedChecker
#check_user_block_status, #check_user_not_blocked
Methods included from NeedsSnippets
Methods included from HttpCachingDisabler
Methods included from HasStoredPath
#skip_store_location?, #store_current_location
Methods included from RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#show ⇒ Object
8 9 10 11 |
# File 'app/controllers/decidim/notifications_settings_controller.rb', line 8 def show :read, :user, current_user: current_user @notifications_settings = form(NotificationsSettingsForm).from_model(current_user) end |
#update ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/decidim/notifications_settings_controller.rb', line 13 def update :update, :user, current_user: current_user @notifications_settings = form(NotificationsSettingsForm).from_params(params) UpdateNotificationsSettings.call(current_user, @notifications_settings) do on(:ok) do flash.now[:notice] = t("notifications_settings.update.success", scope: "decidim") end on(:invalid) do flash.now[:alert] = t("notifications_settings.update.error", scope: "decidim") end end render action: :show end |