1 ActionView::Base.field_error_proc = proc do |html_tag, _instance|
 
   2   class_attr_index = html_tag.index 'class="'
 
   5     html_tag.insert class_attr_index + 7, "field_with_errors "
 
   7     html_tag.insert html_tag.index(%r{/?>}), ' class="field_with_errors"'.html_safe