Created
August 16, 2012 08:32
-
-
Save yasuoza/3368420 to your computer and use it in GitHub Desktop.
Rails customize error Message HTML
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| | |
errors = Array(instance.error_message).join(',') | |
%(#{html_tag}<span class="validation-error"> #{errors}</span>).html_safe | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://guides.rubyonrails.org/active_record_validations_callbacks.html#customizing-the-error-messages-html