This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
2010-01-14 10:30:53 +00:00
|
|
|
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'
|
2010-01-14 10:30:53 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def find_snippets
|
2010-01-18 07:52:52 +00:00
|
|
|
@snippets = Snippet.all( :conditions => { :parent_name => @parent_item.name } )
|
2010-01-14 10:30:53 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|