title: jQuery AJAX request (Rails 3) gets redirected and returns empty message body (only with SSL)!
body: <p>I'm trying to do a manual jQuery AJAX request the following way:</p>
  
  <pre><code>$("#user_plan_id").change(function() {
      $("#plan_container").load('/plans/' + this.value);
  });
  </code></pre>
  
  <p>I have the "rails.js" file included in my header, and a "&lt;%= csrf_meta_tag %>".</p>
  
  <p>I see from my log that the request IS getting to the server (although without the authenticity token... does rails.js even do this?), but the response is a 302 (Found) rather than 200, and no data actually gets rendered.</p>
  
  <p>Any ideas?</p>
  
  <p>Edit: I now see that the first request redirects, and the proper partial gets rendered on the redirect. However, the 2nd response's body (on the client-side) is still empty. I'm guessing jQuery uses the first response and doesn't have a listener set up for the redirect. How do I get around this? </p>
  
  <p>Also, another note: the page doing the requesting is an HTTPS page.</p>
  
  <p>Here is what my log says:</p>
  
  <pre><code>Started GET "/plans/221168073" for 127.0.0.1 at Tue Jun 15 01:24:06 -0400 2010
    Processing by PlansController#show as HTML
    Parameters: {"id"=&gt;"221168073"}
  DEPRECATION WARNING: Using #request_uri is deprecated. Use fullpath instead. (called from ensure_proper_protocol at /Users/ernestsurudo/Sites/vidfolia/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb:57)
  Redirected to http://vidfolia.com/plans/221168073
  Completed 302 Found in 1ms
  </code></pre>
  
  <p>It turns out that if I turn off SSL requirement for that page, it works! I still have no idea why, though. So I suppose my question is: what is the workaround?</p>