In assets/javascripts/blog.js.coffee
console.log('123')
When page is loaded, this is in html (development mode):
<script src="/assets/blog.js?body=1" type="text/javascript"></script>
Content of this file:
(function() {
console.log('123');
}).call(this);
But when page is loaded browser console is empty, this means that js is not executed.
In what could be the problem? Thanks in advance for your reply.
You can’t expect invalid Coffeescript to produce expected results.
Rename your file to
assets/javascripts/blog.jsor change the content of the file to