Fixed Item#parent_name again

This commit is contained in:
Wen-Tien Chang committed 2010-02-22 17:09:39 +08:00
1 parent 93169b1098
commit 496d73487b
4 files changed
+8 -8

No files matched your search

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