Plugins - Validation Group
Add to favoritesUsing the plugin, you can define validationgroups on the model level, defining which fields you would like to validate. When you create an instance of model, you can set the desired validationgroup to use. This is useful for wizard type forms where you want to do validation as you step along the forms, instead of having to do it at the end.
Here is an example:
class User < ActiveRecord::Base
validates _ presence_of :name, :description, :address, :email
validation _ group :step1, :fields=>[:name, :description]
validation _ group :step2, :fields=>[:address]
end
Here is how you enable the validation group
@user = User.new
@user.enable_validation_group :step1
@user.valid?
http://alexkira.blogspot.com/2007/09/rails-validation-using-validation.html
http://validationgroup.rubyforge.org/svn/tags/validationgroup
Rails' (MIT)
Model
