stevegrossi/stevegrossi

View on GitHub
app/controllers/books_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class BooksController < ApplicationController

  def index
    @books_by_year = Book.includes(:post).order(end_date: :asc, start_date: :asc).group_by(&:year_read).to_a.reverse.to_h
  end

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

end