```ruby
class BooksController < ApplicationController

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

Add conditional to /books controller action so that only account holders can access book index
user
```ruby
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```
assistant