When creating forms, Rails will wrap the input fields in divs with class field_with_errors. However, this breaks the display of the input group fields and shrinks them or changes the size, etc. Can you please make the fields display properly even with these wrappers? For example, the HAML
.form-group
=cf.label :revenue
.input-group
.input-group-addon $
=cf.number_field :revenue, class: 'form-control'
generates
<div class="form-group">
<label for="deal_company_attributes_revenue">Revenue</label>
<div class="input-group">
<div class="input-group-addon">$</div>
<input class="form-control" type="number" name="deal[company_attributes][revenue]" id="deal_company_attributes_revenue">
</div>
</div>
and when there is an error generates
<div class="form-group">
<div class="field_with_errors"><label for="deal_company_attributes_revenue">Revenue</label></div>
<div class="input-group">
<div class="input-group-addon">$</div>
<div class="field_with_errors"><input class="form-control" type="number" value="" name="deal[company_attributes][revenue]" id="deal_company_attributes_revenue"></div>
</div>
</div>
This changes the field width display to be shorter, so short there isn't enough room to see the numbers.
I'm using https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css
Are you sure this behaviour you are writing about isn't possible to opt out?
https://coderwall.com/p/s-zwrg/remove-rails-field_with_errors-wrapper
No planned changes here鈥攚e kinda need the markup we use. Sounds like this can be opted out of though given @rafalp's comment.
Most helpful comment
Are you sure this behaviour you are writing about isn't possible to opt out?
https://coderwall.com/p/s-zwrg/remove-rails-field_with_errors-wrapper