Delete users
This commit is contained in:
parent
8921b6464a
commit
c3f17592bc
|
@ -29,6 +29,13 @@ module Management
|
|||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@user = find_user
|
||||
@user.destroy
|
||||
|
||||
redirect_to action: :index
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def find_user
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue