Skip to content

Instantly share code, notes, and snippets.

@askehansen
Created December 17, 2013 15:21
Show Gist options
  • Save askehansen/8006620 to your computer and use it in GitHub Desktop.
Save askehansen/8006620 to your computer and use it in GitHub Desktop.
ActiveRecord error messages
module ErrorMessage
def error_message(joiner='. ')
self.errors.full_messages.join(joiner)
end
end
ActiveRecord::Base.send(:include, ErrorMessage)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment