public
Description: RailsUndoRedo, Undo/Redo for Rails Models, including helpers to implement multi-level Undo/Redo, all in one plugin
Homepage: http://blog.nanorails.com/rails-undo-redo
Clone URL: git://github.com/psq/rails-undo-redo.git
Pascal Belloncle (author)
Wed Jan 30 22:17:36 -0800 2008
name age message
file .gitignore Loading commit data...
file MIT-LICENSE
file README
file Rakefile
file init.rb
directory lib/
directory migrations/
directory spec/
README
= RUR (Rails mutli-level Undo Redo)

This plugin can handle creating an undo stack for any modification to any model that includes the statement:

 acts_as_undoable

== recording changes

Wrap any code that changes any ActiveRecord model in a controller with

 changes("Description of change") do
   ...
 end

== Undo/Redo

From any controller, to Undo, call

 UndoManger.undo

To Redo the previous action

 UndoManger.redo

TBD-1: should any controller include an undo/redo method (which would simplify the helpers)

== Undo stack depth

TBD-1

== View helpers

At least one controller needs to implement undo/redo (unless TBD-1?).

These 2 helpers return the description of the action to be undone, and the one to be redone.

undo_description
redo_description

So, for example 

 link_to undo_description, { :action => "undo" }
 link_to redo_description, { :action => "redo" }


== Migration

A migration is included in the migrations directory which must be run before using this plugin.