public
Description: A Rails plugin to implement interview-style workflows in a controller.
Clone URL: git://github.com/seancribbs/restful_workflow.git
Search Repo:
name age message
folder MIT-LICENSE Fri May 02 16:01:31 -0700 2008 Initial commit [seancribbs]
folder README Sat May 03 10:53:49 -0700 2008 Remove test dir, update README. [seancribbs]
folder Rakefile Fri May 02 16:01:31 -0700 2008 Initial commit [seancribbs]
folder init.rb Fri May 02 16:01:31 -0700 2008 Initial commit [seancribbs]
folder lib/ Sat May 03 16:57:13 -0700 2008 Added symbol only return value option to forwar... [Loren Johnson]
folder spec/ Sat May 03 16:57:13 -0700 2008 Added symbol only return value option to forwar... [Loren Johnson]
folder tasks/ Fri May 02 16:01:31 -0700 2008 Initial commit [seancribbs]
README
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