Update user_controller.rb

Refactored update user method