I tried to implement the "Rendering JSON in actions" example from
http://wiki.rubyonrails.com/rails/pages/HowtoGenerateJSON :

@headers["Content-Type"] = "text/plain; charset=utf-8"
data = { :foo => 'bar', :etc => 'rez' }
render :text => data.to_json

When I try to decode this in javascript with

transport.responseText.evalJSON(true);

I get this error:

SyntaxError: Badly formed JSON string: '{foo: "bar2", etc: "rez"}'

javascript seems to expect double quote around the key strings. does
anyone know how I get this to work?

thanks in advance!!!
Björn


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to