bouquins-ror/app/controllers/series_controller.rb

25 lines
490 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
2015-08-14 08:10:22 +00:00
@serie = Serie.includes(books: :authors).references(:book).find(params[:id])
2015-06-28 15:14:47 +00:00
@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-08-14 08:10:22 +00:00
@title = t(: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