Add Item#ancestors
This commit is contained in:
1 parent
e1440a79d8
commit
32e8bd108f
17 files changed
+60
-37
No files matched your search
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user