Even though JSON is really cool I'm not sure if thats what I need.
I have the Pragmatic Prototype and Scriptaculous book and in there
AJAX samples they didn't need toJSON.
check out my pastie.

I just not sure how to work with serialized info once its passed to
webrick.


On Jan 30, 1:48 pm, "Justin Perkins" <[EMAIL PROTECTED]> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to