2011-10-08 17:36:38 -04:00
|
|
|
class ProfileController < ApplicationController
|
2011-11-02 11:21:17 -04:00
|
|
|
layout "profile"
|
2011-10-08 17:36:38 -04:00
|
|
|
def show
|
|
|
|
@user = current_user
|
|
|
|
end
|
|
|
|
|
2011-12-20 15:47:09 -05:00
|
|
|
def design
|
|
|
|
@user = current_user
|
|
|
|
end
|
|
|
|
|
|
|
|
def update
|
2011-10-19 18:34:05 -04:00
|
|
|
@user = current_user
|
|
|
|
@user.update_attributes(params[:user])
|
2011-12-20 15:47:09 -05:00
|
|
|
redirect_to :back
|
2011-10-19 18:34:05 -04:00
|
|
|
end
|
|
|
|
|
2012-05-19 05:00:46 -04:00
|
|
|
def token
|
|
|
|
@user = current_user
|
|
|
|
end
|
|
|
|
|
2011-10-08 17:36:38 -04:00
|
|
|
def password
|
|
|
|
@user = current_user
|
|
|
|
end
|
|
|
|
|
|
|
|
def password_update
|
2011-10-26 09:46:25 -04:00
|
|
|
params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"}
|
2011-10-08 17:36:38 -04:00
|
|
|
@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
|
2011-11-15 08:08:20 -05:00
|
|
|
|
|
|
|
def reset_private_token
|
|
|
|
current_user.reset_authentication_token!
|
2012-05-19 05:00:46 -04:00
|
|
|
redirect_to profile_token_path
|
2011-11-15 08:08:20 -05:00
|
|
|
end
|
2011-10-08 17:36:38 -04:00
|
|
|
end
|