X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ef7f3d800cbdd49b692df10d312e5fd880e2e938..c1415d43b4c817ae096115cac9b000b4076c8fca:/config/initializers/field_error.rb diff --git a/config/initializers/field_error.rb b/config/initializers/field_error.rb index 6ddacda96..34b224296 100644 --- a/config/initializers/field_error.rb +++ b/config/initializers/field_error.rb @@ -2,8 +2,8 @@ ActionView::Base.field_error_proc = proc do |html_tag, _instance| class_attr_index = html_tag.index 'class="' if class_attr_index - html_tag.insert class_attr_index + 7, 'field_with_errors ' + html_tag.insert class_attr_index + 7, "field_with_errors " else - html_tag.insert html_tag.index(/\/?>/), ' class="field_with_errors"' + html_tag.insert html_tag.index(%r{/?>}), ' class="field_with_errors"'.html_safe end end