title: How to make Ajax calls with Rails 3 using remote_function?
body: <p>I am trying to make an onchange call on a select box.For my application i am using jquery.js and rails.js as mentioned to make use of UJS. But still the code that is generated is for Prototype and not for jquery ajax calls. My code looks like the following:</p>
  
  <pre><code>&lt;%= select_tag :category, 
         options_for_select(
             Category.find(:all,:select=&gt;"name,id").collect{|c| [c.name,c.id]}),
         :onchange =&gt; remote_function(:url =&gt; {:controller =&gt; "posts", 
                                               :action =&gt; "filter_post",
                                               :filter =&gt;"category"}, 
                                      :with=&gt;"'category_id=' + $('#category').val()") %&gt;
  </code></pre>
  
  <p>The code that is generated by this is:</p>
  
  <pre><code>new Ajax.Request('/posts/filter_posts?filter=category', {asynchronous:true, evalScripts:true,
  parameters:'category_id=' + $('#category').val() + '&amp;authenticity_token=' +
  encodeURIComponent('CCyYj1wqXtddK6pUV6bAxw0CqZ4lbBxDGQHp13Y/jMY=')})
  </code></pre>