Project

wizardz

0.0
No commit activity in last 3 years
No release in over 3 years
Multi-Step wizard that deals with multiple models and changing step options based on previous step input
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.2.9
 Project Readme

Wizardz¶ ↑

Multi-Step Creation Wizard

Design to provide a framework for creating multi-step wizard which can have multiple models and user-selectable steps ordering based on user input within earlier steps.

The Gem is provides a Wizardz::Wizard class which is exposed to the Controller and manages the various steps within the creation process and a Wizardz::Page class with represents the individual pages within the Wizardz. Both class are designed to be inherited from within the final implementation and expose the following methods:

Wizardz::Wizard


STATES => Constant which contains the HASH of Page Identifier and Page Class pairs def create => Combines the data for the Associated Pages and create the required Objects <page_name> => Ability to Access page objects via method call

Wizardz::Page


IDENTIFER => Identifier lookup which should match to the Page Identifier from The Wizardz::Wizard:STATES Constant PARTIAL => Contant name of the Partial to be displayed within the view for the page def initialize(data) => Load the required Attributes onto the Page Class (set any default values here) def get_valid_states(states) => Update the list page transistion order after page data update def get_object => Return instance of the underlying object (in memory only - do not save to table) (only required if page_object and valid NOT overwritten def page_object => return object instance (with valid? call if page has already been visited) def valid? => return true/false if object is valid (default implementation calls valid? on get_object)

  • To Do

  • Add example Implementation to show functionality in practise

  • Add Controller Methods => Use multiple calls to the Create method (change pages instead of creating object)

Note on Patches/Pull Requests¶ ↑

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 David Henry. See LICENSE for details.