class BooksController < ApplicationController

  def list
    @book_pages, @books = paginate :books, :per_page => 10
  end

  def show
    @book = Book.find(params[:id])
  end

  def search
    @book = Book.find_by_isbn(params[:isbn])
    if @book
      redirect_to :action => 'show', :id => @book.id
    else    
      flash[:error] = 'No books found.'
      redirect_to :action => 'list'
    end
  end
end