Class: Spooky::PagesController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



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

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

  render_404 unless @pages
end

#showObject



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

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