Admin able to delete every other user except admins(feature)
This commit is contained in:
parent
e51cf148d2
commit
ad544a117f
2 changed files with 18 additions and 0 deletions
|
|
@ -16,4 +16,15 @@ class Admin::UsersController < ApplicationController
|
|||
user.update_attributes!(params[:user])
|
||||
redirect_to admin_users_path, :notice => "Updated #{user.email}"
|
||||
end
|
||||
|
||||
def delete
|
||||
@user = User.find(params[:id])
|
||||
end
|
||||
|
||||
def destroy
|
||||
@user = User.find(params[:id])
|
||||
@user.destroy
|
||||
redirect_to admin_users_path, :notice => "User got deleted"
|
||||
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue