Fixed Item#parent_name
This commit is contained in:
1 parent
9fa03db2c0
commit
f9b1618ac7
4 files changed
+16
-8
No files matched your search
@@ -5,14 +5,14 @@ class Admin::ItemsController < ApplicationController
|
||||
before_filter :find_snippets, :only => :index
|
||||
|
||||
def index
|
||||
@items = Item.all( :conditions => { :parent_name => @parent_item.name } )
|
||||
@items = Item.all( :conditions => { :parent_id => @parent_item.id } )
|
||||
@items.unshift Item.find_by_name("root") if @parent_item.name == 'root'
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def find_snippets
|
||||
@snippets = Snippet.all( :conditions => { :parent_name => @parent_item.name } )
|
||||
@snippets = Snippet.all( :conditions => { :parent_id => @parent_item.id } )
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user