Friday, August 17, 2012

Re: [Rails] Re: Passing array of objects to javascript

On Fri, Aug 17, 2012 at 2:56 PM, Jason Walsh <lists@ruby-forum.com> wrote:

> Think i've find a solution using good old google - like you suggest
> using object.to_json to create a data attribute on a div looks the way
> to go.

Using a data attribute on a div could work. Or you could make it the
contents of a hidden div. Or you could assign the value to an object
and use the object in a call to a JS function defined separately. Or
you could do similarly with a literal. Or you could make your JS
obtrusive instead of defining it elsewhere. There are a gazillion
ways you could go with it, but yeah, it mostly boils to to_json....

-Dave

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate