...that was close to what I did... see my message (just sent).. I left the
array out of it, and just grouped the Hashes as in an object...


On 6/9/07, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
>
>
> Hey Gareth, howzit? :-)
>
> Gareth Evans a écrit :
> > Could someone else identify the best way to get an array of hashes
> > (which is returned as a string from an ajax call) and then get something
> > you can iterate?
>
> So if I get you right, you're saying that the following responseText
> (just abbreviating with '...' in there):
>
> '[ { hash1... }, { hash2... } ...]'
>
> won't get eval'd properly when you do xhr.responseText.evalJSON
> ().  Correct?
>
> What if you tried to wrap it in an extra object with a single property,
> something like:
>
> '{ data: [ { hash1... }, { hash2... } ...] }'
>
> And then you'd access the data property of the eval'd object?  Would
> that work for you?  I'm sorry I don't have time to test this just now,
> but I thought I'd suggest a possible lead.
>
> 'HTH
>
> --
> Christophe Porteneuve aka TDD
> [EMAIL PROTECTED]
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-spinoffs@googlegroups.com
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