Flowdock
method

as_json

Importance_1
v4.0.2 - Show latest stable - 0 notes - Class: ActiveModel::Errors
as_json(options=nil) public

Returns a Hash that can be used as the JSON representation for this object. You can pass the :full_messages option. This determines if the json object should contain full messages or not (false by default).

person.errors.as_json                      # => {:name=>["can not be nil"]}
person.errors.as_json(full_messages: true) # => {:name=>["name can not be nil"]}
Show source
Register or log in to add new notes.