edit authors, delete users, UI changes
This commit is contained in:
parent
e36cc36947
commit
ccb6e23960
19 changed files with 190 additions and 75 deletions
|
@ -1,4 +1,10 @@
|
|||
class UsersController < ApplicationController
|
||||
before_action :ensure_admin, only: [:destroy]
|
||||
|
||||
def index
|
||||
@users = User.all
|
||||
end
|
||||
|
||||
def new
|
||||
@user = User.new
|
||||
end
|
||||
|
@ -45,4 +51,9 @@ class UsersController < ApplicationController
|
|||
redirect_to '/welcome', notice: 'Recovery link expired or invalid'
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
User.destroy(params[:id])
|
||||
redirect_to '/users'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue