Getting Rid of Error Divs around fields that have errors


#1

Is there a way to get rid of the divs around an error field. These
divs are causing me headaches. Any suggestions :-)?

John K.
http://www.kopanas.com

=====================================================================
http://www.soen.info - source of the freshest software engineering
information on the net
http://cusec.soen.info - software engineering conference


#2

Try this CSS to fix your layout problems.

div.fieldWithErrors { display:inline; }


#3

I still get XHTML validation errors. I would like to just not have
the extra divs added. There must be an easy way to do this?

On 13-Feb-06, at 3:17 PM, Bob S. wrote:

Subject: [Rails] Getting Rid of Error Divs around fields that have
http://www.soen.info - source of the freshest software engineering
Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

John K.
http://www.kopanas.com

=====================================================================
http://www.soen.info - source of the freshest software engineering
information on the net
http://cusec.soen.info - software engineering conference


#4

I still get XHTML validation errors. I would like to just not have
the extra divs added. There must be an easy way to do this?
in enviroment.rb put for example this (replace divs with spans)
ActionView::Base.field_error_proc = Proc.new { |html_tag, instance|
“<span class=“fieldWithErrors”>#{html_tag}” }

or for remove the divs:

ActionView::Base.field_error_proc = Proc.new { |html_tag, instance|
“#{html_tag}” }