[LRUG] Best practices for javascript in Rails apps

David Salgado david at digitalronin.com
Thu Jul 18 05:56:40 PDT 2013


On 18 July 2013 13:10, Frederick Cheung <frederick.cheung at gmail.com> wrote:

> There's still a slightly awkward feeling when I want to pass a larger
> chunk of data to the javascript. I normally end up with a inline javascript
> snippet setting window.foo but I've never felt very happy about that.


I use gon for that;

https://github.com/gazay/gon

Also mentioned here;

http://railscasts.com/episodes/324-passing-data-to-javascript

It's doing the same thing under the hood, but it's a nice encapsulation.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20130718/8ce23d9e/attachment.html>


More information about the Chat mailing list