title: How to set a rails variable equal to a Javascript variable?
body: <p>I want to do something similar to <a href="https://stackoverflow.com/questions/2592109/how-to-pass-a-javascript-variable-to-rails-controller">How to pass a Javascript variable to Rails Controller?</a> but I can't seem to get it working for my purposes. I'm using drag and drop jQuery to transfer "items" to "pods". Here's my code:</p>
  
  <pre><code>function onReceive(id,pod_id){
  var id = id;
  var pod_id = pod_id;
  confirm("Add " +id + " to " + pod_id + "?");
  }
  </code></pre>
  
  <p>What I want to do is really something like this: </p>
  
  <pre><code>function onReceive(id,pod_id){
  &lt;% @pod_id = pod_id %&gt;
  &lt;% @id = id %&gt;
  }
  </code></pre>
  
  <p>But I know that the solution isn't quite that easy. How can I pass id and pod_id to my controller? Ideally, I'd like to pass it to the update action. P.S.: I don't know AJAX at all, so if that's the only way please provide details...</p>