Skip to content

Instantly share code, notes, and snippets.

@mrmicahcooper
Created March 1, 2013 19:54
Show Gist options
  • Select an option

  • Save mrmicahcooper/5067262 to your computer and use it in GitHub Desktop.

Select an option

Save mrmicahcooper/5067262 to your computer and use it in GitHub Desktop.
require 'active_model'
def errors_on(attribute)
self.valid?
[self.errors[attribute]].flatten.compact
end
alias :error_on :errors_on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment