Created
October 19, 2013 22:31
-
-
Save apux/7062328 to your computer and use it in GitHub Desktop.
field with errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
if instance.instance_of? ActionView::Helpers::Tags::Label | |
html_tag | |
else | |
%(<div class="form-field error">#{html_tag}<small class="error"> #{[*instance.error_message].join(', ')}</small></div>).html_safe | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment