calling javascript functions from html in rails 3.1
问题 Using coffeescript, jQuery, and sprockets in rails 3.1 the coffeescript files are compiled in to blocks like: (function() { var a; var b; var c; foo = function() { alert("foo"); } bar = function() { alert("bar"); } }).call(this); This seems to move functions foo and bar out of global scope, so bar can be called by foo, but neither can be called from the html code. When I try to call foo from a select onchange element, I get a "Can't find variable: foo". The workaround right now is to move all