Class: UsersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- UsersController
- Defined in:
- app/controllers/users_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
25 26 27 28 |
# File 'app/controllers/users_controller.rb', line 25 def destroy @user.destroy redirect_to users_url, notice: t('general.form.destroyed') end |
#edit ⇒ Object
14 15 |
# File 'app/controllers/users_controller.rb', line 14 def edit end |
#index ⇒ Object
10 11 12 |
# File 'app/controllers/users_controller.rb', line 10 def index @users = User.order('name ASC') end |
#resource ⇒ Object
30 31 32 |
# File 'app/controllers/users_controller.rb', line 30 def resource @user end |
#update ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/controllers/users_controller.rb', line 17 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 |