title: Posting JSON via JQuery to Rails
body: <p>I'm having a surprisingly tough time getting json to post from javascript to a rails backed web service.</p>
  
  <p>Here is the jquery code;</p>
  
  <pre><code>&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  var jsonPost = { 
        "email":"dummy@dummy.com",
        "token":"63uO6eEfLVBFpnZswzI",
        "content": "testcontent",
        "notification_type": "2",
        "name":"testname",
  }
    function callback(data){alert(data)};
  
  jQuery.ajax({
          type: "POST",
          url: 'http://localhost:3000/api/create.json',
          data: jsonPost,
          success: callback,
          dataType: "json",
          contentType: "application/json",
          processData: false
        });
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>On the rails side:</p>
  
  <pre><code>def api_create
    respond_to do |format|
      format.json {
        email = params[:email]
        token = params[:token]
        auto_action = params[:auto_action]
  </code></pre>
  
  <p>The rails side does recognize the request as JSON, but I see no data in the request when debugging in rails.</p>
  
  <p>Could someone point me in the right direction?</p>