Created
December 15, 2011 17:30
-
-
Save tom025/1481980 to your computer and use it in GitHub Desktop.
Grabbing errors from nested objects from an ActiveRecord::ValidationError
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e.record.errors.each_error {|key, err| e.record.send(key).map{|attr| pp "#{key}: #{attr.errors.full_messages}" } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment