title: Rails 3 f.select set up for use in jQuery submitted form
body: <p>I'm using jQuery to submit <code>f.select</code> on a search form using Ransack. For the longest time I didn't know why the Ransack search form I was using wasn't working, and it turned down it had to do with the set-up of my <code>f.select</code>. I was using:</p>
  
  <pre><code>&lt;%= f.select :profile_subject_cont, options_for_select([['Select', 'nil'], ['Arts']... ['Vocational']], @q) %&gt;
  </code></pre>
  
  <p>Instead of:</p>
  
  <pre><code>&lt;%= f.select :profile_subject_cont, options_for_select([['Select', ''], ['Arts']... ['Vocational']], @q) %&gt;
  </code></pre>
  
  <p>What I'd like to do with my <code>f.select</code> is two-fold:</p>
  
  <ol>
  <li>When I select an option in my <code>f.select</code>, my form is submitted and the option that was submitted as a param is shown as the selected option. Currently what happens is the option is submitted as a param, but the <code>f.select</code> resets when the form is submitted, leaving "Select" as the selected value.</li>
  <li>If I can get #1 to work, I'd like the selection of "Select" to reset the search_form's param for <code>profile_subject</code>. It looks like currently the form submits with params when the option is selected, but when the results are rendered the <code>profile_subject</code> params go back to nothing. (That's probably why I can't get post back to work.</li>
  </ol>
  
  <p>Does anyone know how I can get this to work? It has plagued me too long. Here's the jQuery I'm using to submit the form just in case:</p>
  
  <pre><code>$(function(){
      $('select').live('change',function() {
          $(this).closest('form#index').submit();
      });
  });
  </code></pre>