Hey all, rails 2.1 When I do this from the controller: render :xml => @address.errors, :status => :unprocessable_entity I get a malformed root node in the XML <active-record/errors type="array"> ... </active-record/errors> # note the extra slashes However when I do this in the console: address.errors.to_xml I get the following which seems fine: <errors> ... </errors> Any ideas on why the discrepancy and perhaps a fix for the controller bit? Thanks in advance! Tim
Tim wrote:> Hey all, > > rails 2.1 >...> Any ideas on why the discrepancy and perhaps a fix for the controller > bit?Odd. I just tried this out of curiosity in Rails 2.3.3 and it worked as expected: <?xml version="1.0" encoding="UTF-8"?> <errors> <error>Title can''t be bland</error> </errors> A Rails 2.1 bug possibly?? -- Posted via ruby-forum.com.
Robert Walker wrote:> <?xml version="1.0" encoding="UTF-8"?> > <errors> > <error>Title can''t be bland</error>Obviously, titles must be interesting to be accepted. hehe. Sorry, I meant to type "blank."> </errors>-- Posted via ruby-forum.com.