public
Description: A Rails plugin to implement interview-style workflows in a controller.
Homepage:
Clone URL: git://github.com/seancribbs/restful_workflow.git
Loren Johnson (author)
Sat May 03 17:02:13 -0700 2008
commit  3b6ab16ce4f5aa220714d3beecb47d369df80a28
tree    902d36474679bc3594f9836f828f7c402118f0af
parent  649c73694fed4218b0a183e31c2a08b3018abe85 parent  79202da1ca7ad07f162a82f3874174a441951899
restful_workflow / README
100644 41 lines (31 sloc) 1.068 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
RestfulWorkflow
===============
 
This plugin provides interview-style workflow in a controller, similar to
TurboTax, but without the need to save models to the database immediately.
All data is stored in the session unless overridden.
 
Using this DSL implements the 'show' and 'update' actions in your controller,
so please do not override those unless you wish to break the workflow. When
rendering, each step will look for a template of the same name.
 
Example
=======
 
class InterviewController < ApplicationController
 
  stage do |steps|
    steps.start do
      data do
        column :first_name, :type => :string
        validates_presence_of :first_name
      end
    end
    
    steps.contact_info do
      before { @name = self.class.find_step('start').load_data(self).first_name }
      data do
        column :email, :type => :string
        column :accept, :type => :boolean
        validates_acceptance_of :accept
      end
      forward "/profile"
    end
  end
 
end
 
 
Copyright (c) 2008 Sean Cribbs and Loren Johnson, released under the MIT
license