Skip to content

Instantly share code, notes, and snippets.

@jackhong
Created November 16, 2012 00:25
Show Gist options
  • Save jackhong/4082758 to your computer and use it in GitHub Desktop.
Save jackhong/4082758 to your computer and use it in GitHub Desktop.
Replace error_messages for
# @bob is the object binding to the form
-if @bob.errors.any?
#error_explanation
%h2= "#{pluralize(@bob.errors.count, "error")} prohibited this from being saved:"
%ul
- @bob.errors.full_messages.each do |msg|
%li= msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment