aboutsummaryrefslogtreecommitdiffstats
path: root/lib/use_spans_for_errors.rb
blob: cda05c588f69c68ffb52389b803de8c659bfa61b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# Monkeypatch! Use SPAN instead of DIV. 
#
# Rails core refuse to fix this properly, by making it an official option.
# Without it, you will get HTML validation errors in various places where an
# error appears within a P.
#
# A monkeypatch will have to do.
#
# See http://dev.rubyonrails.org/ticket/2210

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