class BooksController < ApplicationController

  get '/books' do
    @user = User.find(session[:user_id])
    @books = @user.books
    erb :'/books/books'
  end
end
class BooksController < ApplicationController

  get '/books' do
    if session[:user_id]
      @user = User.find(session[:user_id])
      @books = @user.books
      erb :'/books/books'
    else
      redirect to '/login'
    end
  end
end
Add conditional to /books controller action so that only account holders can access book index
Add conditional to /books controller action so that only account holders can access book index
