我已經在我的控制器以下變量怎樣才能在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'。 –