books quantity

This commit is contained in:
Karol Selak 2021-03-22 01:24:13 +01:00
parent c2dfc1f04a
commit 733870ce96
7 changed files with 58 additions and 27 deletions

View file

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