I'm writing CoffeeScript inside a Ruby on Rails 3.2.13 project, but it seems to compile to an improper JavaScript. My code is:
$('#a').change () ->
$('#b').hide()
The coffeescript.org online compiler compiles it as:
$('#a').change(function() {
return $('#b').hide();
});
Whereas for some reason when my project runs in the development environment compiles it as:
(function() {
$('#a').change(function() {
return $('#b').hide();
});
}).call(this);
What's the reason behind this? And Does it have any implication?
Edit
In extension to edovic's answer, I found the answer to how can I use option “--bare” in Rails 3.1 for CoffeeScript