Class: PagesController

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

Instance Method Summary collapse

Instance Method Details

#showObject

Raises:

  • (ActionController::RoutingError)


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

def show

  raise ActionController::RoutingError.new("Page Not Found") if current_page.nil?

  if current_page.using_slug_backup?
    redirect_to current_page.url, status: :moved_permanently
  else
    # call controller hook
    self.send(current_page.identifier) if self.respond_to? current_page.identifier

    render "cardboard/pages/show", layout: @layout || "layouts/application"
  end
end