ryanb/nested_form — pull request #243 by michaelglass (2013-02-20 08:52:36+00:00)
Title: Length validator

no tests yet, but this should work.

continued to implement https://github.com/ryanb/nested_form/pull/46, adding prototype and a few small changes:

by default, using length validators will not be used.

use length validatiors globally with
```
config.nested_form.use_length_validators = true
```
in your application.rb

use length validations on a per-association level by passing the :check_maximum option
```
f.link_to_add :tasks, check_maximum: true
```
if check_maximum is passed in but a validator can't be chosen (either because there are none or more than 1) link_to_add will raise an NestedForm::UnresolvedLengthValidator error

if you just want to set a maximum without checking a length validator, pass it in
```
f.link_to_add :tasks, maximum: 5
```
this will override any length validators