Class: PagesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- PagesController
- 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
-
#show ⇒ Object
Finds the requested Page or raises ActiveRecord::RecordNotFound.
Instance Method Details
#show ⇒ Object
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 |