2015-06-28 12:29:09 +00:00
|
|
|
class BooksController < ApplicationController
|
2015-07-04 18:10:58 +00:00
|
|
|
include PreferencesHelper
|
|
|
|
|
|
|
|
before_action :preferences, only: :index
|
2015-06-28 12:29:09 +00:00
|
|
|
|
|
|
|
def show
|
2015-06-28 12:59:37 +00:00
|
|
|
@book = Book.find(params[:id])
|
2015-06-28 13:03:30 +00:00
|
|
|
@title = @book.title
|
2015-06-28 12:59:37 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def index
|
2015-07-04 18:10:58 +00:00
|
|
|
@books = Book.where(initial_filter).order(:sort)
|
|
|
|
.paginate(page: params[:page], per_page: session[:current_per_page])
|
2015-06-28 13:03:30 +00:00
|
|
|
@title = "Books"
|
2015-06-29 16:58:02 +00:00
|
|
|
respond_to do |format|
|
|
|
|
format.html
|
|
|
|
format.js
|
|
|
|
end
|
2015-06-28 12:29:09 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|