bouquins-ror/app/controllers/authors_controller.rb

22 lines
425 B
Ruby
Raw Normal View History

2015-06-28 15:14:47 +00:00
class AuthorsController < ApplicationController
include PreferencesHelper
before_action :preferences, only: :index
2015-06-28 15:14:47 +00:00
def show
@author = Author.find(params[:id])
@title = @author.name
end
def index
@authors = Author.where(initial_filter).order(:sort)
.paginate(page: params[:page], per_page: session[:current_per_page])
2015-06-28 15:14:47 +00:00
@title = "Authors"
2015-06-29 16:58:02 +00:00
respond_to do |format|
format.html
format.js
end
2015-06-28 15:14:47 +00:00
end
end