Add Item#ancestors

This commit is contained in:
Wen-Tien Chang committed 2010-01-18 15:52:52 +08:00
1 parent e1440a79d8
commit 32e8bd108f
17 files changed
+60 -37

No files matched your search

+2 -2
View File
@@ -32,9 +32,9 @@ class ApplicationController < ActionController::Base
end
def find_parent_item
@parent_item = Item.find_by_name(params[:parent_item_name] || 'root')
@parent_item = Item.find_by_name(params[:parent_name])
unless @parent_item
@parent_item = Page.create( :name => 'root', :title => t(:homepage), :layout_name => "root" )
@parent_item = Page.create( :name => "root", :title => "root", :layout_name => "root" )
end
end