bouquins-ror/app/controllers/series_controller.rb

25 lines
444 B
Ruby
Raw Normal View History

2015-06-28 15:14:47 +00:00
class SeriesController < ApplicationController
include PreferencesHelper
before_action :preferences, only: :index
2015-06-28 15:14:47 +00:00
def show
@serie = Serie.find(params[:id])
@title = @serie.name
end
def index
2015-08-04 17:32:38 +00:00
@series = Serie.where(query_filter(Serie.table_name))
.includes(books: :authors)
.references(:books)
.order(:sort)
.paginate(pagination)
2015-06-28 15:14:47 +00:00
@title = "Series"
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