Functions in coffeescript

Hi, I just tried this code on

a = (msg) ->
  alert msg


and it worked fine. When I put the first part of it (defining a) in a 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");

OK, found answer

put it like this:

@a = (msg) ->
  alert msg

in coffeescript file. This will make variable a global