Add Item#ancestors
This commit is contained in:
1 parent
e1440a79d8
commit
32e8bd108f
17 files changed
+60
-37
No files matched your search
@@ -5,13 +5,14 @@ class Admin::ItemsController < ApplicationController
|
||||
before_filter :find_snippets, :only => :index
|
||||
|
||||
def index
|
||||
@items = Item.all( :conditions => { :parent_item_name => @parent_item.name } )
|
||||
@items = Item.all( :conditions => { :parent_name => @parent_item.name } )
|
||||
@items.unshift Item.find_by_name("root") if @parent_item.name == 'root'
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def find_snippets
|
||||
@snippets = Snippet.all( :conditions => { :parent_item_name => @parent_item.name } )
|
||||
@snippets = Snippet.all( :conditions => { :parent_name => @parent_item.name } )
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user