I''ve been trying to understand this for a bit now, and I can''t
find
any discussion on why the change was made. The default value used to
be false, but now it is true?
When I do something like this it is nice to have the root value:
format.json { render :json => @user }
{"user":{}}
But if I want to output extra variables too it gets annoying to have
the root node twice
format.json { render :json => { :success => true, :user => @user } }
{"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, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.