Outputting strict JSON


#1

Does any body know how I can output JSON so that instead of getting:

{booking: {id: 1, name: “foo”}

You get this instead:

{id: 1, name: “foo”}

Can’t find a solution for this at all

Thank you for any help.


#2

On 7 May 2009, at 12:37, lyntaff removed_email_address@domain.invalid wrote:

Does any body know how I can output JSON so that instead of getting:

{booking: {id: 1, name: “foo”}

There should be an initializer in your app called something like
new_rails_defaults.rb that shows you how to control this


#3

Thanks, That worked great.

On May 7, 8:59 pm, Frederick C. removed_email_address@domain.invalid