Sha256: 15cf6946c24d45455717d529fd723feac36f02e2d4844be44fd071ad20331bd4

Contents?: true

Size: 443 Bytes

Versions: 42

Compression:

Stored size: 443 Bytes

Contents

ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
  error_class = "x-form-text x-form-invalid"
  if html_tag =~ /<(input|textarea|select)[^>]+class=/
    class_attribute = html_tag =~ /class=['"]/
    html_tag.insert(class_attribute + 7, "#{error_class} ")
  elsif html_tag =~ /<(input|textarea|select)/
    first_whitespace = html_tag =~ /\s/
    html_tag[first_whitespace] = " class='#{error_class}' "
  end
  html_tag
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
lipsiadmin-5.1.9 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.1.8 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.1.7 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.1.6 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.1.5 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.1.4 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.1.3 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.1.2 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.1.1 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.1.0 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.0.9 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.0.8 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.0.7 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.0.6 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.0.5 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.0.4 lib/view/helpers/active_record_helper.rb
lipsiadmin-4.1.8 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.0.0 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.0.1 lib/view/helpers/active_record_helper.rb
lipsiadmin-5.0.2 lib/view/helpers/active_record_helper.rb