Sha256: 4aa5c7dda34df4cd84f6e7901d959db8f28332f24263aa3cb25cf1a92a95a8ad

Contents?: true

Size: 480 Bytes

Versions: 10

Compression:

Stored size: 480 Bytes

Contents

# The public-facing controller. Responsible for getting {Page} objects, collecting their {ContentBlock}s, and rendering their templates.
class PagesController < ApplicationController
  layout 'public'

  caches_page :show

  # Finds the requested {Page} or raises ActiveRecord::RecordNotFound.
  def show
    if @page = Page.find(params[:id])
      @content_blocks = @page.content_blocks
      render @page.slug
    else
      raise ActiveRecord::RecordNotFound
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
manifest-rails-0.2.8 app/controllers/pages_controller.rb
manifest-rails-0.2.7 app/controllers/pages_controller.rb
manifest-rails-0.2.6 app/controllers/pages_controller.rb
manifest-rails-0.2.5 app/controllers/pages_controller.rb
manifest-rails-0.2.4 app/controllers/pages_controller.rb
manifest-rails-0.2.3 app/controllers/pages_controller.rb
manifest-rails-0.2.2 app/controllers/pages_controller.rb
manifest-rails-0.2.1 app/controllers/pages_controller.rb
manifest-rails-0.2.0 app/controllers/pages_controller.rb
manifest-rails-0.1.3 app/controllers/pages_controller.rb