Sha256: afaca5f7e501e46076d5ed4f4475f163f85dc7a7465560bbfdf8609c1f8636dc
Contents?: true
Size: 511 Bytes
Versions: 11
Compression:
Stored size: 511 Bytes
Contents
class BooksController < ApplicationController before_action :set_author before_action :set_book, only: :show # GET /authors/author-slug/books def index @books = @author.books end # GET /authors/author-slug/books/book-slug def show end private # Use callbacks to share common setup or constraints between actions. def set_book @book = @author.books.friendly.find(params[:id]) end def set_author @author = Author.friendly.find(params[:author_id]) end end
Version data entries
11 entries across 11 versions & 1 rubygems