On Jan 30, 2008 10:40 AM, OmenKing <[EMAIL PROTECTED]> wrote:
> (1) serializing and passing with Ajax
Try using toJSON() on the collection, like:
tasks = $A([
{ :id => 1, :name => 'Foo' },
{ :id => 2, :name => 'Bar' },
]);
tasks.toJSON()
> Where are the %5B%5D coming from?
Those are escaped characters. They need to be unescaped on the server.
> (2) parsing it in ruby
Since you're not using Rails, which has handy helpers for dealing with
JSON, you need to include your own implementation to parse JSON or
write your own.
-justin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---