Hi, I just tried this code on coffeescript.org

a = (msg) ->
  alert msg

a("booo")

and it worked fine. When I put the first part of it (defining a) in a
.js.coffee file and call a("booo"); in my view it simply doesn't work.
This is the error firebug throws out:

a is not defined
[Break On This Error]

a("boom thata");

-----------------------

This is what the compiled js file looks like:

(function() {
var a;
a = function(msg) {
return alert(msg);
};
}).call(this);

What went wrong?

-- 
Posted via http://www.ruby-forum.com/.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en-US.

Reply via email to