Allowing to delete users
This commit is contained in:
parent
d8e68caa12
commit
c5808a4fdc
3 changed files with 21 additions and 4 deletions
|
|
@ -65,6 +65,14 @@ module Admin
|
|||
|
||||
def edit; end
|
||||
|
||||
def destroy
|
||||
if @user.destroy
|
||||
redirect_to admin_users_path, notice: "User #{@user.name} (#{@user.email}) was successfully deleted."
|
||||
else
|
||||
redirect_to admin_users_path, error: "Could not delete user #{@user.name} (#{@user.email}). #{@user.errors.full_messages.join('. ')}."
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def user_params
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue