How can I use option --bare in Rails 3.1 for CoffeeScript?

Someone know how can I use this option in Rails 3.1?
Now CoffeScript puts a function “.call(this)” on each file, but I want
to remove this.

+1 This seems to affect functions too, since Coffeescript makes
into vairables, and those variables aren’t available outside of that

If you want to run it both on node and client you can do something like
(taken from

root = exports ? @

root.alertMe =(msg) ->
alert msg

alertMe ‘hi there’

The following should actually work too for client side only (not battle
tested here though)

@.alertMe =(msg) ->
alert msg

It is a matter of personal style I guess

you can use

class window.MyClassName or
window.functionName =

Check out this here:

No need to go bare.

On Fri, May 27, 2011 at 3:54 AM, Kieran P [email protected] wrote:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs