Rails Validation fieldWithErrors annoyance

So I’m thoroughly annoyed that a fieldWithErrors div wraps around a field that fails validation. I added a file called field_with_error_fix.rb in config/initializers to solve this pesky problem. It has the following code:

ActionView::Base.field_error_proc = Proc.new { |html_tag, instance|
"<span class=\"fieldWithErrors\">#{html_tag}</span>" }

Goodbye inappropriate divs!

Tags: , , , ,


You can skip to the end and leave a response. Pinging is currently not allowed.

ONE RESPONSE SO FAR...

  1. cbmeeksAugust 26th, 2008 at 1:25 pm

    Thank you.

    This was driving me friggin’ crazy.

    ~cbmeeks

LEAVE YOUR MARK