summaryrefslogtreecommitdiff
path: root/app/controllers/profile_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/profile_controller.rb')
-rw-r--r--app/controllers/profile_controller.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/controllers/profile_controller.rb b/app/controllers/profile_controller.rb
new file mode 100644
index 00000000000..666c6309dce
--- /dev/null
+++ b/app/controllers/profile_controller.rb
@@ -0,0 +1,21 @@
+class ProfileController < ApplicationController
+ def show
+ @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"
+ redirect_to new_user_session_path
+ else
+ render :action => "password"
+ end
+ end
+end