chicks/sugarcrm — Issue #70: Formatting Record list as XML or JSON
Author: jwhitcraft
Created: 2011-12-03 04:55:18+00:00
State: open

Currently if you have this code:

```ruby
bugs = class_for('Bug')

@bug_list = bugs.all.sort_by do |a|
[a.bug_number]
end

respond_to do |format|
format.html # list.html.erb
format.json { render :json => @bug_list }
format.xml { render :xml => @bug_list }
end
```

And you try and go to the json or xml format they don't produce valid json and xml data. The json just dumps out where as the xml at least tries to produce xml.