I took some code posted by mikel (http://groups.google.com/group/activescaffold/browse_frm/thread/5405ad849f28e181/#) and turned it into a plugin that you can drop into your Active Scaffold Rails app to easily support reordering in a list of models that implement acts_as_list.
http://activescaffold.googlegroups.com/web/active_scaffold_acts_as_list.tar.gz
You’ll need a version of Active Scaffold later than 1.0.1 (tested on trunk 2007-06-19)
svn export http://activescaffold.googlecode.com/svn/trunk/ vendor/plugins/active_scaffold
Unpack tgz file into your vendor/plugins directory
If the model you are scaffolding uses acts_as_list, the reorder icons should automatically appear in the list.
If you are just getting started with acts_as_list and Active Scaffold, you probably want to make sure that you set the default sorting to use the position column (and any scoping columns). You might also want to add the position column to your list view. If you use sorting, it wouldn’t really be required, but if the user sorts by a different column or worse, if there are items that don’t have a position number yet, the buttons can be behaving properly, but the reordering can look a bit odd in the list without the position column.
active_scaffold :branches do |c|
c.list.sorting = [:tree_id, :position]
c.list.columns << :position
end
If you have a scaffold for which you don’t want the reordering enabled, just exclude the action.
active_scaffold :leaves do |c|
c.actions.exclude :reorder
end