A thing that caused me some friction a while back was that the form fields and label helpers end up wrapped separately with a div.field_with_errors.
This changes the layout and can break certain style with flexbox if the label and field are not sibling element.
Shouldn’t the error just be a css class on the field or the parent div.field ? I do so through
ActionView::Base.field_error_proc in an initializer, but modifying the class in this proc is less than trivial.
People seems to either use nokogiri or they do it through a text search like this:
Both feels like an inefficient way to go about it instead of changing the field before it is rendered to text. It would be nice if the proc was instead a hook that could allow us to change the parameters of the field before it is rendered.
Also, I can’t find field_error_proc in the Rails api doc. So is it even public api? I imagine not.