我正在使用 Rails 和 CoffeeScript,需要在:coffeescript标签下的 Haml 文件中定义和调用函数。
我尝试使用此代码,但它会生成“未定义tabsOnLoadMethod”错误:
:coffeescript
$ ->
tabsOnLoadMethod ->
alert 'hello team'
我使用tabsOnLoadMethod();.
错误:
ReferenceError: tabsOnLoadMethod is not defined
这哪里出错了?