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