Sha256: 7a74cc24fcffe1fe83c21b2e4e3b70f090bd4443183704d8b765eb809c5e7dda
Contents?: true
Size: 457 Bytes
Versions: 27
Compression:
Stored size: 457 Bytes
Contents
# frozen_string_literal: true ActionView::Base.field_error_proc = proc do |html_tag, _instance| if html_tag =~ /<(input|textarea|select)/ error_class = 'input__error' doc = Nokogiri::XML(html_tag) doc.children.each do |field| next if field['type'] == 'hidden' next if field['class'] =~ /\berror\b/ field['class'] = "#{field['class']} #{error_class}".strip end doc.to_html.html_safe else html_tag end end
Version data entries
27 entries across 27 versions & 1 rubygems