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