Admin able to delete every other user except admins(feature)

This commit is contained in:
Gopesh Tulsyan 2014-03-09 11:58:57 +05:30
parent e51cf148d2
commit ad544a117f
2 changed files with 18 additions and 0 deletions

View file

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