trailblazer / formular

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

Collection format #7

Closed blelump closed 8 years ago

blelump commented 8 years ago

Hi @fran-worley :smile:

it seems a collection is rendered as

[[:id, :value], [:id, :value]]

whereas I'd propose to render the opposite, eg:

[[:value, :id], [:value, :id]]

because that's the way most libs operate (eg. AV, simple_form). I think it's just easier to follow the convention in this case, because anyone that would like to use Formular is able to follow his habits. Especially when it's not a bad habit. Just for consideration.

fran-worley commented 8 years ago

Completely agree. I'll change it and get back to you.

It should support label_method and value_method options (same as simple form) if you want to do it this way now.

fran-worley commented 8 years ago

Done :)

https://github.com/trailblazer/formular/commit/7dc26e1e9e42507f30b6da73e5aaa11150202f5c