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
functions
into vairables, and those variables aren’t available outside of that
scope.

If you want to run it both on node and client you can do something like
this
(taken from
http://stackoverflow.com/questions/4214731/coffeescript-global-variables):

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: http://coffeescript-seattlejs.heroku.com/

No need to go bare.

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

http://groups.google.com/group/rubyonrails-talk?hl=en.

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