title: Pass js variable to server code
body: <p>I have a form with 2 inputs and button.  An user put feed url in the first input and press the button:</p>
  
  <pre><code>&lt;%= link_to "get name", { :controller =&gt; 'Feeds', :action =&gt; "get_title" }, 
  :remote =&gt; true, :class=&gt;'btn btn-mini' %&gt;       
  </code></pre>
  
  <p>Here is controller method</p>
  
  <pre><code>def get_title
     respond_to do | format |  
         format.js {render :layout =&gt; false}  
     end
  end
  </code></pre>
  
  <p>And here is a get_title.js.erb:</p>
  
  <pre><code>var url = $( "#feed_url" ).val();
  console.log(url);
  $( "#feed_name" ).val("&lt;%= @proxy.title(url) %&gt;");
  </code></pre>
  
  <p>I get value of the first input and want to pass it as parameter to Ruby class.  But in this case I get the error:</p>
  
  <pre><code>ActionView::Template::Error (undefined local variable or method `url' for #&lt;#&lt;Class:0x41ec170&gt;:0x41ef968&gt;):
      1: var url = $( "#feed_url" ).val();
      2: console.log(url);
      3: $( "#feed_name" ).val("&lt;%= @proxy.title(url) %&gt;");
  </code></pre>
  
  <p>Rails this that 'url' is a Ruby variable, but not JS one.</p>
  
  <p>How can I pass JS variable to Ruby code ?</p>
  
  <p>Thanks in advance.</p>