diff options
| author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-07-31 08:32:49 +0300 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-07-31 08:32:49 +0300 |
| commit | 5926bbac12d5831e1ad90964272b96e152a72e34 (patch) | |
| tree | e222160f8f35e7dd772dbd124eef089592efc9c2 /app/controllers/profile_controller.rb | |
| parent | 69e41250d1b1eea609ae63f2702d5888396cba9a (diff) | |
| download | gitlab-ce-5926bbac12d5831e1ad90964272b96e152a72e34.tar.gz | |
Backend Refactoring
Diffstat (limited to 'app/controllers/profile_controller.rb')
| -rw-r--r-- | app/controllers/profile_controller.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/controllers/profile_controller.rb b/app/controllers/profile_controller.rb index 0da463757f3..0322a039631 100644 --- a/app/controllers/profile_controller.rb +++ b/app/controllers/profile_controller.rb @@ -1,30 +1,26 @@ class ProfileController < ApplicationController layout "profile" + before_filter :user + def show - @user = current_user end def design - @user = current_user end def update - @user = current_user @user.update_attributes(params[:user]) redirect_to :back end def token - @user = current_user end def password - @user = current_user end def password_update params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"} - @user = current_user if @user.update_attributes(params[:user]) flash[:notice] = "Password was successfully updated. Please login with it" @@ -38,4 +34,10 @@ class ProfileController < ApplicationController current_user.reset_authentication_token! redirect_to profile_token_path end + + private + + def user + @user = current_user + end end |
