Fixed Item#parent_name

This commit is contained in:
Wen-Tien Chang committed 2010-02-22 15:27:11 +08:00
1 parent 9fa03db2c0
commit f9b1618ac7
4 files changed
+16 -8

No files matched your search

+2 -2
View File
@@ -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