Delete users

This commit is contained in:
Andrew Radev 2015-05-25 11:29:22 +03:00
parent 8921b6464a
commit c3f17592bc
2 changed files with 8 additions and 1 deletions

View File

@ -29,6 +29,13 @@ module Management
end
end
def destroy
@user = find_user
@user.destroy
redirect_to action: :index
end
private
def find_user

View File

@ -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