diff options
author | Evelyn <evy_mcr@outlook.com> | 2015-09-20 13:53:53 -0500 |
---|---|---|
committer | Evelyn <evy_mcr@outlook.com> | 2015-09-20 13:53:53 -0500 |
commit | 9c350b60e87a58e4fcf748fe3c9bc1baa5c04655 (patch) | |
tree | c4fd007e20381daa16ce57ee4f4fcdc8fb8dca2e /app/controllers/users_controller.rb | |
parent | 3e8771097ab7392560fdf07a85c011c23098fd1e (diff) |
adding ability to disable/enable users by admin
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r-- | app/controllers/users_controller.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3943afc..446b726 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -49,13 +49,15 @@ class UsersController < ApplicationController def deactivate @user.enabled = false @user.save - respond_with @user + flash[:notice] = I18n.t("actions.user_disabled_message", username: @user.username) + redirect_to :back end def enable @user.enabled = true @user.save - respond_with @user + flash[:notice] = I18n.t("actions.user_enabled_message", username: @user.username) + redirect_to :back end def destroy |