X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/933b0913304fdd581c7cb3f1ec30450d6e04c63a..0a3b052cf617955571fa88b1bba4290cd27d38d6:/config/initializers/field_error.rb?ds=sidebyside diff --git a/config/initializers/field_error.rb b/config/initializers/field_error.rb index 41f2c2d52..34b224296 100644 --- a/config/initializers/field_error.rb +++ b/config/initializers/field_error.rb @@ -1,9 +1,9 @@ -ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| +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