Sha256: b6321cdc0a452af36836b76e5187dc2a896e9a64bdb08344590d7838de85be84
Contents?: true
Size: 895 Bytes
Versions: 43
Compression:
Stored size: 895 Bytes
Contents
# frozen_string_literal: true module Decidim # The controller to handle the user's notifications settings page. class NotificationsSettingsController < Decidim::ApplicationController include Decidim::UserProfile def show authorize! :show, current_user @notifications_settings = form(NotificationsSettingsForm).from_model(current_user) end def update authorize! :update, 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 end end
Version data entries
43 entries across 43 versions & 2 rubygems