I follow the API instructions, but the form behavior doesn't output what it says it should in the example and example source code.
I installed simpleform and bootstrap. I did rails g simple_form:install --bootstrap I see that the files have been generated.
Simpleform says to do code for an element like so
= simple_form_for @park, html: { multipart: true, role: "form", class: "form-horizontal" } do |f|
- if @park.errors.any?
#error_explanation
%h2= "#{pluralize(@park.errors.count, "error")} prohibited this park from being saved:"
%ul
- @park.errors.full_messages.each do |msg|
%li= msg
= f.input :address, label: 'address', autofocus: true, placeholder: "123 Fake Street Irvine, CA 90123", class: "form-control"
The layers of DSLs for simple output of forms is getting kind of ridiculous.
Many things wrong with the output
1) the wrapping classes don't match bootstrap's form-group
, and instead it's still controls
2) the form doesn't stretch out 100% width like it should.
3) If an input isn't detected as "required", the label doesn't get wrapped, and it sticks off to the left of the screen.
Why isn't the API working?