Class: UsersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- UsersController
- Defined in:
- app/controllers/users_controller.rb
Instance Method Summary collapse
- #change_password ⇒ Object
- #edit ⇒ Object
- #historical_time ⇒ Object
- #index ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#change_password ⇒ Object
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 sign_in(@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 |
#edit ⇒ Object
19 20 |
# File 'app/controllers/users_controller.rb', line 19 def edit end |
#historical_time ⇒ Object
36 37 |
# File 'app/controllers/users_controller.rb', line 36 def historical_time end |
#index ⇒ Object
12 13 14 |
# File 'app/controllers/users_controller.rb', line 12 def index @users = User.unlocked.sort_by_name end |
#show ⇒ Object
16 17 |
# File 'app/controllers/users_controller.rb', line 16 def show end |
#update ⇒ Object
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 |