made some changes to the update profile

This commit is contained in:
Ken Johnson
2013-04-25 16:51:45 -04:00
parent 6a3dec43f8
commit 6d24bf8993
+5 -4
View File
@@ -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