summaryrefslogtreecommitdiff
path: root/app/controllers/profile_controller.rb
blob: 666c6309dce298aa5a65cb8249894f85e4655490 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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