person.errors.messages# => {:name=>["cannot be nil"]}person.errors.get(:name)# => ["cannot be nil"]person.errors.get(:age)# => []
# File activemodel/lib/active_model/errors.rb, line 123
def get(key)
ActiveSupport::Deprecation.warn( ActiveModel::Errors#get is deprecated and will be removed in Rails 5.1. To achieve the same use model.errors[:#{key}]..squish)
messages[key]
end