made some changes to the update profile
This commit is contained in:
@@ -22,10 +22,11 @@ class UsersController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if not (!current_user.email == params[:user][:email] || User.where(:email => params[:user][:email]).exists?)
|
current_user.update_attributes(params[:user].reject { |k| k == "password" })
|
||||||
current_user.update_attributes(params[:user])
|
pass = params[:user][:password]
|
||||||
end
|
current_user.password = pass if !(pass.blank?)
|
||||||
redirect_to user_account_settings_path(:user_id => current_user.id)
|
current_user.save!
|
||||||
|
redirect_to user_account_settings_path(:user_id => current_user.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user