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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en-US.