From 26631f9981a826ebe4aeba726e9be2b813d2c5c5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 29 Mar 2016 18:59:03 +0200 Subject: Change how notification settings in profile are rendered and updated Signed-off-by: Dmitriy Zaporozhets --- app/controllers/groups/notification_settings_controller.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/controllers/groups/notification_settings_controller.rb (limited to 'app/controllers/groups') diff --git a/app/controllers/groups/notification_settings_controller.rb b/app/controllers/groups/notification_settings_controller.rb new file mode 100644 index 00000000000..78e43c83aba --- /dev/null +++ b/app/controllers/groups/notification_settings_controller.rb @@ -0,0 +1,14 @@ +class Groups::NotificationSettingsController < Groups::ApplicationController + def update + notification_setting = group.notification_settings.where(user_id: current_user).find(params[:id]) + saved = notification_setting.update_attributes(notification_setting_params) + + render json: { saved: saved } + end + + private + + def notification_setting_params + params.require(:notification_setting).permit(:level) + end +end -- cgit v1.2.1