Skip to content

Instantly share code, notes, and snippets.

@apux
Created October 19, 2013 22:31
Show Gist options
  • Save apux/7062328 to your computer and use it in GitHub Desktop.
Save apux/7062328 to your computer and use it in GitHub Desktop.
field with errors
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">&nbsp;#{[*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