Orbit/app/controllers/admin/items_controller.rb

19 lines
462 B
Ruby
Raw Normal View History

class Admin::ItemsController < ApplicationController
layout "admin"
before_filter :find_parent_item
before_filter :find_snippets, :only => :index
def index
2010-01-18 07:52:52 +00:00
@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
2010-01-18 07:52:52 +00:00
@snippets = Snippet.all( :conditions => { :parent_name => @parent_item.name } )
end
end