diff options
author | Benjamin Neff <benjamin@coding4coffee.ch> | 2016-08-10 01:11:49 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2016-08-10 14:16:59 +0300 |
commit | 86e75a02bb0ecb00f326cb3493cb9e54b91bb17e (patch) | |
tree | e3b99334252f298ac56c3df74ae7ed08771b0dfd /app/controllers | |
parent | 37837b3f731670509b4c3a8f22c170ba8efed0ee (diff) |
fix privacy settings form submit
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/users_controller.rb | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 367f642fb..e2c43ab31 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -40,12 +40,6 @@ class UsersController < ApplicationController else flash[:notice] = I18n.t "users.update.settings_not_updated" end - elsif u[:strip_exif] - if @user.update_attributes(u) - flash[:notice] = I18n.t "users.update.settings_updated" - else - flash[:notice] = I18n.t "users.update.settings_not_updated" - end elsif u[:language] if @user.update_attributes(u) I18n.locale = @user.language @@ -92,6 +86,18 @@ class UsersController < ApplicationController end end + def update_privacy_settings + privacy_params = params.fetch(:user).permit(:strip_exif) + + if current_user.update_attributes(strip_exif: privacy_params[:strip_exif]) + flash[:notice] = t("users.update.settings_updated") + else + flash[:error] = t("users.update.settings_not_updated") + end + + redirect_to :back + end + def destroy if params[:user] && params[:user][:current_password] && current_user.valid_password?(params[:user][:current_password]) current_user.close_account! @@ -194,7 +200,6 @@ class UsersController < ApplicationController :invitation_service, :invitation_identifier, :show_community_spotlight_in_stream, - :strip_exif, :auto_follow_back, :auto_follow_back_aspect_id, :remember_me, |