我已经在我的控制器以下变量怎样才能在HAML
class MyController < ApplicationController
def my_method
@status = "status"
end
end
我
haml
观点
,我尝试以下使用红宝石变量内嵌的JavaScript,但它不工作(因为其使用默认.erb语法)
#app/views/mycontroller/me_method.html.haml
:javascript
alert(<%=raw @status %>)
我如何使用我的在线Java脚本里面的@status
变量,提前
除非'me_method'我找不到任何错误的可能错字'my_method'。 –