Sha256: 4dfd1f0a713d43751c2a2b95b23eeba78b0c237414c587510f19c129bddfbcca

Contents?: true

Size: 542 Bytes

Versions: 9

Compression:

Stored size: 542 Bytes

Contents

class PagesController < ApplicationController
  before_filter :find_structure
  before_filter :set_header
  
  caches_action :show, :layout => false
  
  def show
    @page = @structure.page || Page.new
    respond_with(@page)
  end
  
  protected
  
    def find_structure
      @structure = Structure.with_kind(StructureType.page).find_by_slug(params[:id])
      raise ActiveRecord::RecordNotFound.new("Structure #{params[:id]} not found") if @structure.nil?
    end
    
    def set_header      
      head_options(@structure)
    end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sunrise-core-0.2.2 app/controllers/pages_controller.rb
sunrise-core-0.2.1 app/controllers/pages_controller.rb
sunrise-core-0.2.0 app/controllers/pages_controller.rb
sunrise-core-0.1.5 app/controllers/pages_controller.rb
sunrise-core-0.1.4 app/controllers/pages_controller.rb
sunrise-core-0.1.3 app/controllers/pages_controller.rb
sunrise-core-0.1.2 app/controllers/pages_controller.rb
sunrise-core-0.1.1 app/controllers/pages_controller.rb
sunrise-core-0.1.0 app/controllers/pages_controller.rb