2011-10-08 23:36:38 +02:00
|
|
|
class ProfileController < ApplicationController
|
|
|
|
def show
|
|
|
|
@user = current_user
|
|
|
|
end
|
|
|
|
|
2011-10-20 00:34:05 +02:00
|
|
|
def social_update
|
|
|
|
@user = current_user
|
|
|
|
@user.update_attributes(params[:user])
|
|
|
|
redirect_to [:profile]
|
|
|
|
end
|
|
|
|
|
2011-10-08 23:36:38 +02:00
|
|
|
def password
|
|
|
|
@user = current_user
|
|
|
|
end
|
|
|
|
|
|
|
|
def password_update
|
2011-10-26 15:46:25 +02:00
|
|
|
params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"}
|
2011-10-08 23:36:38 +02: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
|
|
|
|
end
|