to_hash

to_hash(full_messages = false)
Instance Public methods

Returns a Hash of attributes with their error messages. If full_messages is true, it will contain full messages (see full_message).

person.errors.to_hash       # => {:name=>["cannot be nil"]}
person.errors.to_hash(true) # => {:name=>["name cannot be nil"]}
doc_ruby_on_rails
2015-06-20 00:00:00
Comments
Leave a Comment

Please login to continue.