rosa-build/lib/ext/rails/render_errors_in_forms.rb

8 lines
255 B
Ruby
Raw Normal View History

2011-03-31 00:52:34 +01:00
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
if html_tag =~ /<label/
%|<div class="fieldWithErrors">#{html_tag} <span class="error">#{[instance.error_message].join(', ')}</span></div>|.html_safe
else
html_tag
end
2012-01-30 20:39:34 +00:00
end