Class: PagesController

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

Overview

The public-facing controller. Responsible for getting Page objects, collecting their ContentBlocks, and rendering their templates.

Instance Method Summary collapse

Instance Method Details

#showObject

Finds the requested Page or raises ActiveRecord::RecordNotFound.



8
9
10
11
12
13
14
15
# File 'app/controllers/pages_controller.rb', line 8

def show
  if @page = Page.find(params[:id])
    @content_blocks = @page.content_blocks
    render @page.slug
  else
    raise ActiveRecord::RecordNotFound
  end
end