Class: Spooky::AuthorsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/spooky/authors_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
6
7
8
9
10
11
12
# File 'app/controllers/spooky/authors_controller.rb', line 3

def index
  @authors, @pagination = ghost.authors(
    include: "count.posts",
    filter: "visibility:public",
    page: params[:page].presence,
    limit: params[:limit].presence
  )

  render_404 unless @authors
end

#showObject



14
15
16
17
# File 'app/controllers/spooky/authors_controller.rb', line 14

def show
  @author = ghost.author_by(slug: params[:id])
  render_404 unless @author
end