trailblazer / formular

Form builder for Ruby. Fast, Furious, and Framework-Agnostic.
MIT License
81 stars 17 forks source link

optimize default value handling #34

Closed aiomaster closed 7 years ago

aiomaster commented 7 years ago

I found it strange, that formular evaluates default values even if I give it with options. Example:

f.input :foo, value: 'bar'

It tries to call the model method foo, but it is useless, cause the value is given already. By that pull request this is refactored and makes it possible to build such input fields, even if the model does not has these methods, by providing a value in options.

Thanks

(I know that the erb test is failing again on CI, but this is not my fault)

fran-worley commented 7 years ago

I've incorporated this into 1532a4a59fb44dd62616d52e872b35ab70e2df7f

Thanks for pointing this out, a very good point!