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