Class: UsersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- UsersController
- Defined in:
- app/controllers/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
27 28 29 30 |
# File 'app/controllers/users_controller.rb', line 27 def destroy @user.destroy redirect_to users_url, notice: t('general.form.destroyed') end |
#edit ⇒ Object
16 17 |
# File 'app/controllers/users_controller.rb', line 16 def edit end |
#index ⇒ Object
9 10 11 |
# File 'app/controllers/users_controller.rb', line 9 def index @users = User.order('name ASC').paginate(page: params[:page], per_page: 10) end |
#resource ⇒ Object
32 33 34 |
# File 'app/controllers/users_controller.rb', line 32 def resource @user end |
#show ⇒ Object
13 14 |
# File 'app/controllers/users_controller.rb', line 13 def show end |
#update ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/controllers/users_controller.rb', line 19 def update if params[:user][:password].present? ? @user.update_attributes(params[:user]) : @user.update_without_password(params[:user]) redirect_to edit_user_path(@user), notice: t('general.form.successfully_updated') else render :edit end end |