rails 3.1 asset pipeline exposing defined functions and (classes and coffeescript)

10 views
Skip to first unread message

robertj

unread,
Jul 29, 2011, 10:06:43 AM7/29/11
to rubyonra...@googlegroups.com
Hi,

what is the best/preferred/recommended way to expose functions (and classes in coffeescript) 
to the browser.

At the moment i do this

@func = -> "a function def" which translates into
this.func = function(){return "a function def"} 

where this is the browser window.

Actually it works ... however it feels somehow wrong.
I'd rather use the commonJS module system.

Any comments?

Best regards

Robert
Reply all
Reply to author
Forward
0 new messages