search for: include_root_in_json

Displaying 5 results from an estimated 5 matches for "include_root_in_json".

2010 Oct 15
0
Why is include_root_in_json true now
...} } {"success":true, "user:"{"user":{}}}} In the second case it seems weird because I have to double parse the ''user'' key...I assume there is a reason this decision was made so I''d like to understand that. Also, if I do decide to just set include_root_in_json to false, what is the best place to do that. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group,...
2010 Apr 05
2
Harmonizing JSON/XML serialization
The way Rails handles root nodes in JSON and XML serialization is inconsistent. This has been discussed before: https://rails.lighthouseapp.com/projects/8994/tickets/2584-232-activeresource-json-doesnt-send-parameters-with-root-node This seems mostly taken care of with ActiveModel::Base.include_root_in_json, especially if/when it ends up in ActiveResource. However, there is also the issue of how Enumerables are serialized. This ticket would have me believe that it''s a solved issue in Rails 3: https://rails.lighthouseapp.com/projects/8994/tickets/3812-collection-root-for-enumerable-to_json B...
2008 Dec 02
2
ActiveResource - xml and json format return different results
Hi, I''m using Rails 2.1.2. and I wanted to switch ActiveResource format to JSON and thought that it will work smoothly, but unfortunately it wasn''t the case. XML and JSON formats generate different objects: XML version #<User:0xb7658440 @prefix_options={}, @attributes={"created_at"=>Mon Nov 28 11...}> JSON version #<User:0xb746af5c @prefix_options={},
2010 May 01
0
Add custom root option to AR JSON Serializer
...owing: user.to_xml(:root => "xml_user" ) But not following: user.to_json(:root => "json_user") JSON serializer for AR doesn''t allow us to specify "root" option unlike XML serializer. JSON serializer always uses model name as the root if class attribute include_root_in_json is set to true. I''ve added a patch which allows JSON serializer to accepts custom root option. https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4515-patch-add-custom-root-option-to-ar-json-serializer Let me know what you think about the patch. Thanks, Jatinder http:/...
2009 Jul 20
9
Upgrade server to run on Rails 2.3.2/F11
Note that one of the 8 patches (#6) will be sent separately in reply to this email, as some of the replaced lines are too long, so git won't let me send the email. However, there is nothing wrong with that patch, and it should be applied in the sequence listed below. Note also that I assume this will be tested on a clean f11 install, rather than an upgrade of an existing ovirt server