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.
On 7 May 2009, at 12:37, lyntaff <lyn-XFkl2lNNjp7BrJGnFWTVgQ@public.gmane.org> 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> You get this instead: > > {id: 1, name: "foo"} > > Can''t find a solution for this at all > > Thank you for any help. > > >
Thanks, That worked great. On May 7, 8:59 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 7 May 2009, at 12:37, lyntaff <l...-XFkl2lNNjp7BrJGnFWTVgQ@public.gmane.org> 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 > > > You get this instead: > > > {id: 1, name: "foo"} > > > Can''t find a solution for this at all > > > Thank you for any help.
Seemingly Similar Threads
- undefined method `^' for "d":String
- rails 2.2.2 does not work with ruby 1.9.1
- Deploying Error: undefined method 'generate_best_match='
- Undefined method `store_full_sti_class=' for ActiveRecord::Base:Class (NoMethodError)
- [PATCH] Upgrading the server to work with Rails 2.3.4.