title: Accessing Ruby variable inside a Javascript
body: <p>I am new to Javascript. I am writing a view in haml that fills a dropdown box by using JQuery and to fill that box JQuery requires the value of a Ruby variable <code>s_id</code> like following:</p>
  
  <pre><code>$(document).ready(function(){
    var param = s_id  //here s_id is a ruby variable
    ...
  </code></pre>
  
  <p>Here <code>s_id</code> is a ruby variable that is defined in the Haml view file for which the JS get called. Can anyone give any idea how to achieve the above thing.</p>