title: Pass variable from JavaScript to Ruby session
body: <p>I have a simple input text field:</p>
  
  <pre><code>&lt;input type="text" id="master_password" size="20" placeholder="Master Password" /&gt;
  &lt;a class="btn btn-default" id="master_submit" href="#"&gt;Submit&lt;/a&gt;
  </code></pre>
  
  <p>And some javascript listening:</p>
  
  <pre><code>$(document).ready(function() {
    $('#master_submit').click(function() {
      alert("sometext");
    });
  });
  </code></pre>
  
  <p>The alert works, obviously. I want to store the text field (<code>#master_password</code>) in <code>session[:master_pass]</code> as I will be using it to decrypt many passwords stored in the database. I'm pretty sure I have to use some AJAX, but not familiar with it at all. What code would I replace the alert with in the js file (or view, or controller, of course) to store the data as a Ruby variable?</p>