Sha256: 24f78028ae31b41e6646f3e1c5858c2fc4546b68c1bff4ffd423fe160c04a024

Contents?: true

Size: 394 Bytes

Versions: 5

Compression:

Stored size: 394 Bytes

Contents

class PagesController < ApplicationController

  def index
    # Find the first published root page
    @pages = Page.published.shown_in_sitemap.all.group_by(&:parent_id)
  end
  
  def show
    if @page
      respond_to do |format|
        format.html # show.html.erb
        format.xml  { render :xml => @page }
      end
    else
      raise ActiveRecord::RecordNotFound
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
page_engine-0.0.5 app/controllers/pages_controller.rb
page_engine-0.0.4 app/controllers/pages_controller.rb
page_engine-0.0.3 app/controllers/pages_controller.rb
page_engine-0.0.2 app/controllers/pages_controller.rb
page_engine-0.0.1 app/controllers/pages_controller.rb