books quantity
This commit is contained in:
parent
c2dfc1f04a
commit
733870ce96
7 changed files with 58 additions and 27 deletions
|
@ -3,7 +3,7 @@ class BooksController < ApplicationController
|
|||
before_action :ensure_admin, only: [:edit, :update]
|
||||
|
||||
def index
|
||||
if current_user.admin?
|
||||
if current_user&.admin?
|
||||
books = Book.all
|
||||
else
|
||||
books = Book.published
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue