Hi,
I used the below syntax in config/initializers, but i am getting
the error message two times, please suggest me the better way to over
come it

ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
if html_tag =~ /<(input|label|textarea|select)/
error_class = 'error'
nodes = Hpricot(html_tag)
nodes.each_child { |node| node[:class] =
node.classes.push(error_class).join(' ') unless !node.elem? ||
node[:type] == 'hidden' || node.classes.include?(error_class) }
nodes.to_html
else
html_tag
end
end

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 6 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 11, '12 at 1:28p
activeJan 17, '12 at 6:47p
posts6
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase