Class: UsersController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/users_controller.rb

Instance Method Summary collapse

Instance Method Details

#change_passwordObject



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/controllers/users_controller.rb', line 22

def change_password
  @user.password = params[:user][:password]
  @user.password_confirmation = params[:user][:password_confirmation]
  if @user.save
    (@user, :bypass => true)
    flash[:notice] = t(:password_updated_successfully)
    redirect_to :action => :show
  else
    params[:user][:password] = params[:user][:password_confirmation] = ''
    flash.now[:error] = t(:password_updated_unsuccessfully)
    render :edit
  end
end

#editObject



19
20
# File 'app/controllers/users_controller.rb', line 19

def edit
end

#historical_timeObject



36
37
# File 'app/controllers/users_controller.rb', line 36

def historical_time
end

#indexObject



12
13
14
# File 'app/controllers/users_controller.rb', line 12

def index
  @users = User.unlocked.sort_by_name
end

#showObject



16
17
# File 'app/controllers/users_controller.rb', line 16

def show
end

#updateObject



39
40
41
42
43
44
45
46
47
# File 'app/controllers/users_controller.rb', line 39

def update
  if @user.update_attributes(params[:user])
    flash[:notice] = t(:user_updated_successfully)
    redirect_to @user
  else
    flash.now[:error] = t(:user_updated_unsuccessfully)
    render :action => 'edit'
  end
end