Class: PagesController
Instance Method Summary
collapse
#admin?, #error_404, #from_dialog?, #home_page?, #just_installed?, #local_request?, #wymiframe
Methods included from Crud
append_features
Instance Method Details
#home ⇒ Object
3
4
5
6
|
# File 'vendor/plugins/pages/app/controllers/pages_controller.rb', line 3
def home
@page = Page.find_by_link_url("/", :include => [:parts, :slugs])
error_404 unless @page.present?
end
|
#show ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'vendor/plugins/pages/app/controllers/pages_controller.rb', line 8
def show
@page = Page.find(params[:id], :include => [:parts, :slugs])
if @page.live? or (logged_in? and current_user.authorized_plugins.include?("Pages"))
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
|