Sha256: 370450513af59307ede4626adc120fdbfa732b552aec8325c4d0c925d84c70c8

Contents?: true

Size: 511 Bytes

Versions: 7

Compression:

Stored size: 511 Bytes

Contents

#Personalizando mensagens de erro  
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
  error_style = "background-color:#FFEBEB;border-color:#E17984;"
  if html_tag =~ /<(input|textarea|select)[^>]+style=/
    style_attribute = html_tag =~ /style=['"]/
    html_tag.insert(style_attribute + 7, "#{error_style}; ")
  elsif html_tag =~ /<(input|textarea|select)/
    first_whitespace = html_tag =~ /\s/
    html_tag[first_whitespace] = " style='#{error_style}' "
  end
  html_tag
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
flexi_generators-0.2.6 lib/generators/flexi_prepare/templates/custom_field_error.rb
flexi_generators-0.2.5 lib/generators/flexi_prepare/templates/custom_field_error.rb
flexi_generators-0.2.4 lib/generators/flexi_prepare/templates/custom_field_error.rb
flexi_generators-0.2.3 lib/generators/flexi_prepare/templates/custom_field_error.rb
flexi_generators-0.2.2 lib/generators/flexi_prepare/templates/custom_field_error.rb
flexi_generators-0.2.1 lib/generators/flexi_prepare/templates/custom_field_error.rb
flexi_generators-0.2.0 lib/generators/flexi_prepare/templates/custom_field_error.rb