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.
orbit-4-1/app/controllers/admin/items_controller.rb

30 lines
576 B
Ruby
Raw Normal View History

class Admin::ItemsController < ApplicationController
layout "site_editor"
before_filter :authenticate_user!
before_filter :find_parent_item
before_filter :find_snippets, :only => :index
before_filter :is_admin?
2011-05-13 01:08:42 +00:00
before_filter :set_current_item
def index
if params[:item_id]
2011-05-13 01:08:42 +00:00
@item = Item.find(params[:item_id])
else
2011-09-01 01:12:41 +00:00
@item = get_homepage
end
end
def update_position
render :nothing => true
end
protected
def find_snippets
@snippets = Snippet.where( { :parent_id => @parent_item.id } ) rescue nil
end
end