Sha256: c5da33f3b72118412c48d95359c7518c0155b84bc1401a35f1c542eec42770cc
Contents?: true
Size: 661 Bytes
Versions: 10
Compression:
Stored size: 661 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? 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 unless first_live_child.nil? end end end
Version data entries
10 entries across 10 versions & 1 rubygems