Sha256: 792230f5aa5264ee1ababf1e7e68b94ded23d152d1f0b35aaa9aec7cbb0fb51d
Contents?: true
Size: 776 Bytes
Versions: 7
Compression:
Stored size: 776 Bytes
Contents
class PagesController < ApplicationController def home @page = Page.find_by_link_url("/", :include => [:parts, :slugs]) error_404 if @page.nil? respond_to do |wants| wants.html end 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? else respond_to do |wants| wants.html end end end end
Version data entries
7 entries across 7 versions & 1 rubygems