title: jQuery Ajax POST to Rails 3.2.2 not allowed by Access-Control-Allow-Origin
body: <p>I have a simple .ajax post to a rails scaffold project running on Heroku:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"&gt;    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;script&gt;
      $(document).ready(function(){
          $.ajax({
              type: 'POST', url: "http://herokuserver/images.json",
              data: { image: { name: "johngalt1" } }
          });
      });
      &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>As it turns out using the javascript console in Chrome I get:</p>
  
  <pre><code> XMLHttpRequest cannot load http://herokuServer/images.json. Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin.
  </code></pre>
  
  <p>HOWEVER, when I go to the rails app on heroku a new record has been created with the name => "johngalt1". From everything I've read I thought the cross-domain issue with javascript would have prevented the record being created and required me to use json-p or CORS? Or does the javascript cross-domain issue only prevent receiving data from a server via javascript?</p>