Sha256: 28cc4205e821acabbffd67c3a0b4e1c531edf37eb5a002d61b45544a962da8b4

Contents?: true

Size: 572 Bytes

Versions: 12

Compression:

Stored size: 572 Bytes

Contents

class PagesController < ApplicationController

  def home
	  @page = Page.find_by_link_url("/", :include => [:parts, :slugs])
	  error_404 if @page.nil?
  end

	def show
	  @page = Page.find(params[:id], :include => [:parts, :slugs])
		
		error_404 unless @page.live?
		
		# if the admin wants this to be a "placeholder" page which goes to its first child, go to that instead.
		if @page.skip_to_first_child
			first_live_child = @page.children.find_by_draft(false, :order => "position ASC")
			redirect_to first_live_child.url unless first_live_child.nil?
		end
	end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
refinerycms-0.9.4.3 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.4.2 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.4.1 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.4 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.3 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.2.2 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.2.1 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.2 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.1.2 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.1.1 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.1 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.0 vendor/plugins/pages/app/controllers/pages_controller.rb