Module FormValidator::ConstraintHelpers
In: formvalidator.rb
Methods
apply_hash_constraint    apply_proc_constraint    apply_regexp_constraint    apply_string_constraint    delete_empty    delete_unknown    do_constraint    untaint?   
Public Instance methods
do_constraint(key, constraints)

Helper method to figure out what kind of constraint is being run. Valid constraint objects are String, Hash, Array, Proc, and Regexp.

delete_empty()

Delete empty fields.

delete_unknown()

Find unknown fields and delete them from the form.

untaint?(key)

Indicates if @form[key] is scheduled to be untainted.

apply_string_constraint(key, constraint)

Applies a builtin constraint to form[key]

apply_regexp_constraint(key, constraint)

Applies regexp constraint to form[key]

apply_proc_constraint(key, constraint)

applies a proc constraint to form[key]

apply_hash_constraint(key, constraint)

A hash allows you to send multiple arguments to a constraint. constraint can be a builtin constraint, regexp, or a proc object. params is a list of form fields to be fed into the constraint or proc. If an optional name field is specified then it will be listed as the failed constraint in the invalid_fields hash.