ActiveRecord::Base.include_root_in_json = true doesn't seem to work in rails 3.10.rc4, and I don't see it in the docs.
Since the root element is now disabled by default, how to enable it again?
@comments.to_json in rails 3.1 now looks like
[ { comment: "Fun street park.", created_at: 2011-06-29T02:28:29Z, } ]
And in previous versions, it has the root root, which I need to return.
[ { comment: { comment: "Fun street park.", created_at: 2011-06-29T02:28:29Z } } ]
ruby-on-rails ruby-on-rails-3
jspooner
source share