Add dependent destroy and related test for deleting a user
This commit is contained in:
parent
64e191f60e
commit
9a1db8419c
3 changed files with 7 additions and 1 deletions
|
|
@ -33,6 +33,7 @@ module Admin
|
|||
|
||||
def destroy
|
||||
@user = User.find(params[:id])
|
||||
@user.events.destroy_all
|
||||
@user.destroy
|
||||
redirect_to admin_users_path, notice: 'User got deleted'
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue