Closed markrickert closed 9 years ago
I'm okay with removing the requirement. Should we fall back to using the label as the hash key when you call render_form
? Or just skip it altogether?
I think that leaving it out would be fine, but it turns out that FXForm requires it. We may have to fall back to a snake_cased label as a sensible default.
Most of the time, when using something like this to just display some data in fields or a button that does something, you won't need a key.
Also, why are we calling it :name
when fxform calls it :key
?
Also, why are we calling it :name when fxform calls it :key?
In an HTML form, input elements have a name
(which becomes the key to the params
hash in Rails), so I'm following that convention. One of the goals of ProMotion is to make it easy for Rails developers to transition, so it made sense to me to do that.
I'm cool with a snake_cased label as a default. Or even just use the label directly.
render_form
# => {
"Email" => "jamon@clearsightstudio.com",
"Phone" => "3601234567",
}
render_form["Phone Number"] # => "3601234567"
# etc
Cool. patch with test coming soon.
App crashes with this error when you don't provide a
:name
attribute:should
:name
be required?