to_xml(options={})
Instance Public methods
Returns an xml formatted representation of the Errors hash.
1 2 3 4 5 6 7 8 9 | person.errors.add( :name , "can't be blank" ) person.errors.add( :name , "must be specified" ) person.errors.to_xml # => # <?xml version=\"1.0\" encoding=\"UTF-8\"?> # <errors> # <error>name can't be blank</error> # <error>name must be specified</error> # </errors> |
Please login to continue.