gitlabhq/app/controllers/profile_controller.rb
Robert Speicher 7754189187 Fully embrace Ruby 1.9 hash syntax
Didn't bother with files in db/, config/, or features/
2012-08-10 18:25:15 -04:00

44 lines
754 B
Ruby

class ProfileController < ApplicationController
layout "profile"
before_filter :user
def show
end
def design
end
def update
@user.update_attributes(params[:user])
redirect_to :back
end
def token
end
def password
end
def password_update
params[:user].reject!{ |k, v| k != "password" && k != "password_confirmation"}
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
def reset_private_token
current_user.reset_authentication_token!
redirect_to profile_token_path
end
private
def user
@user = current_user
end
end