Skip to content

Instantly share code, notes, and snippets.

@rodrigopinto
Created August 1, 2010 17:42
Show Gist options
  • Select an option

  • Save rodrigopinto/503566 to your computer and use it in GitHub Desktop.

Select an option

Save rodrigopinto/503566 to your computer and use it in GitHub Desktop.
#...
ActionView::Base.default_form_builder = CustomizedErrorFormBuilder
#ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
# if html_tag =~ /<label/
# %|#{html_tag} <font class="error">#{[instance.error_message].join(', ')}</font>|
# else
# error_class = 'fieldWithErrors'
# nodes = Hpricot(html_tag)
# nodes.each_child do |node|
# unless !node.elem? || node[:type] == 'hidden' || node.classes.include?(error_class)
# node[:class] = node.classes.push(error_class).join(' ')
# end
# end
# nodes.to_html
# end
#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment