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