Permalink
Browse files

Fix code for customize the error messages html adding a .html_safe of…

… 8.3 section
  • Loading branch information...
1 parent c8ab399 commit f5a51a778804f7a48b8f43e591ad3bc6b828867e @leohackin leohackin committed with fxn Nov 18, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 railties/guides/source/active_record_validations_callbacks.textile
@@ -824,10 +824,10 @@ Here is a simple example where we change the Rails behaviour to always display t
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
if instance.error_message.kind_of?(Array)
%(#{html_tag}<span class="validation-error">&nbsp;
- #{instance.error_message.join(',')}</span>)
+ #{instance.error_message.join(',')}</span>).html_safe
else
%(#{html_tag}<span class="validation-error">&nbsp;
- #{instance.error_message}</span>)
+ #{instance.error_message}</span>).html_safe
end
end
</ruby>

0 comments on commit f5a51a7

Please sign in to comment.