]> git.openstreetmap.org Git - rails.git/blob - config/initializers/field_error.rb
Merge pull request #1938 from jguthrie100/fix_no_trace_description_error
[rails.git] / config / initializers / field_error.rb
1 ActionView::Base.field_error_proc = proc do |html_tag, _instance|
2   class_attr_index = html_tag.index 'class="'
3
4   if class_attr_index
5     html_tag.insert class_attr_index + 7, "field_with_errors "
6   else
7     html_tag.insert html_tag.index(%r{/?>}), ' class="field_with_errors"'
8   end
9 end