Created
August 1, 2010 17:42
-
-
Save rodrigopinto/503566 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #... | |
| 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