]> git.openstreetmap.org Git - rails.git/blobdiff - config/initializers/field_error.rb
Merge remote-tracking branch 'upstream/pull/2450'
[rails.git] / config / initializers / field_error.rb
index 3ccd1d391a4e6816239e21c6aee33b1f30183980..34b224296cce6506a9f4240fc33083867a2fc404 100644 (file)
@@ -4,6 +4,6 @@ ActionView::Base.field_error_proc = proc do |html_tag, _instance|
   if class_attr_index
     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