user blocking
This commit is contained in:
parent
ccb6e23960
commit
2804c55fd9
9 changed files with 44 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
|||
class UsersController < ApplicationController
|
||||
before_action :ensure_admin, only: [:destroy]
|
||||
before_action :ensure_admin, only: [:destroy, :block]
|
||||
|
||||
def index
|
||||
@users = User.all
|
||||
|
@ -56,4 +56,9 @@ class UsersController < ApplicationController
|
|||
User.destroy(params[:id])
|
||||
redirect_to '/users'
|
||||
end
|
||||
|
||||
def block
|
||||
User.find(params[:id]).update(status: :blocked)
|
||||
redirect_to '/users'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue