justinfrench/formtastic — pull request #1043 by vjt (2014-06-11 01:42:48+00:00)
Title: Add support for configurable namespaced inputs classes

Folks :smile:,

I was looking for a way to put my Input and Action classes outside of the global scope, and I found @mikz pull #921, that set up a nice infrastructure to do just that.

However, @mikz proposal changes Formtastic default behavior from looking up classes only in `Object` and in `Input`/`Actions` to including also the `FormBuilder` class. (I am with @justinfrench on this, I also personally don't like putting inputs inside the builder namespace - but that's a matter of taste :smiley:.)

So, I have built on @mikz code to allow an user to configure the namespaces in which the inputs and actions should be looked up, while preserving the ability to define *the builder itself* as a namespace.

E.g. with

```ruby
Formtastic::FormBuilder.input_namespaces = [ Foo ]
```

inputs will be looked up in `Object` first, then the `Foo` module and eventually in `Formtastic::Inputs`.

With

```ruby
Formtastic::FormBuilder.input_namespaces = proc { self }
```

inputs will be looked up in `Object`, then in the specific `FormBuilder` class (the `proc` is `instance_eval`'ed in the given builder context) and eventually in `Formtastic::Inputs`. This then makes configurable what @mikz is proposing :smile_cat:.

The pull contains also whitespace changes isolated in the [last commit](configurable-namespaced-inputs...configurable-namespaced-inputs^), so please use [this link](https://github.com/vjt/formtastic/compare/justinfrench:master...configurable-namespaced-inputs%5E) for an easier code review.

Thanks for reading and for this great framework! :+1: