I have the following variable in my controller:
class MyController < ApplicationController
def my_method
@status = "status"
end
end
In my haml
view, I tried following, but it doesn't work (since it's using the default .erb syntax):
#app/views/mycontroller/me_method.html.haml
:javascript
alert(<%=raw @status %>)
How can I use the @status
variable inside my inline JavaScript?