Sha256: f6d3992529defeeb6bb1e9383577b589b22096619e2687efb275a2b8896d2a94

Contents?: true

Size: 694 Bytes

Versions: 31

Compression:

Stored size: 694 Bytes

Contents

class PagesController < ApplicationController

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

  def show
    @page = Page.find(params[:id], :include => [:parts, :slugs])

    if @page.live? or (logged_in? and current_user.authorized_plugins.include?("Pages"))
      # 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 if first_live_child.present?
      end
    else
      error_404
    end
  end

end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
jacobat-refinerycms-0.9.6.14 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.29 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.28 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.27 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.26 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.25 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.24 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.23 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.22 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.21 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.19 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.18 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.17 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.16 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.15 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.14 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.13 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.12 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.11 vendor/plugins/pages/app/controllers/pages_controller.rb
refinerycms-0.9.6.10 vendor/plugins/pages/app/controllers/pages_controller.rb