diff --git a/app/controllers/management/users_controller.rb b/app/controllers/management/users_controller.rb index c1d75f4..b70a7cf 100644 --- a/app/controllers/management/users_controller.rb +++ b/app/controllers/management/users_controller.rb @@ -29,6 +29,13 @@ module Management end end + def destroy + @user = find_user + @user.destroy + + redirect_to action: :index + end + private def find_user diff --git a/app/views/management/users/index.html.slim b/app/views/management/users/index.html.slim index add033f..d608b95 100644 --- a/app/views/management/users/index.html.slim +++ b/app/views/management/users/index.html.slim @@ -26,5 +26,5 @@ = icon :eye = link_to edit_management_user_path(user), title: t('actions.edit.button', model: User.model_name.human), class: 'btn btn-primary' = icon :edit - = link_to management_user_path(user), title: t('actions.destroy.button', model: User.model_name.human), class: ['btn', 'btn-danger'], remote: true, method: :delete, data: {confirm: t('actions.are_you_sure')} + = link_to management_user_path(user), title: t('actions.destroy.button', model: User.model_name.human), class: ['btn', 'btn-danger'], method: :delete, data: {confirm: t('actions.are_you_sure')} = icon :trash