Add Item list interface, but acts_as_list can not used

This commit is contained in:
Wen-Tien Chang committed 2010-02-22 16:10:13 +08:00
1 parent f9b1618ac7
commit 93169b1098
7 files changed
+30 -14

No files matched your search

+12
View File
@@ -9,6 +9,18 @@ class Admin::ItemsController < ApplicationController
@items.unshift Item.find_by_name("root") if @parent_item.name == 'root'
end
def up
@item = Item.find(params[:id])
@item.move_higher
redirect_to admin_items_url( :parent_name => @item.parent_name )
end
def down
@item = Item.find(params[:id])
@item.move_lower
redirect_to admin_items_url( :parent_name => @item.parent_name )
end
protected
def find_snippets