gitlab-org--gitlab-foss/app/controllers/profile_controller.rb
Robert Speicher 30a66c065a Improve user feedback on the Profile > Design page
- Header changes immediately without a page reload
- Lets the user know that we actually saved their setting when changed
2012-11-21 15:01:40 -05:00

47 lines
865 B
Ruby

class ProfileController < ApplicationController
before_filter :user
def show
end
def design
end
def update
@user.update_attributes(params[:user])
respond_to do |format|
format.html { redirect_to :back }
format.js
end
end
def token
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 'account'
end
end
def reset_private_token
current_user.reset_authentication_token!
redirect_to profile_account_path
end
def history
@events = current_user.recent_events.page(params[:page]).per(20)
end
private
def user
@user = current_user
end
end