title: Origin http://localhost is not allowed by Access-Control-Allow-Origin Rails 3
body: <p>Follow by this question <a href="https://stackoverflow.com/questions/2535454/how-to-set-access-control-allow-origin-in-webrick-under-rails">How to set access-control-allow-origin in webrick under rails?</a>, I can <code>GET</code> and <code>POST</code> from the <strong><em>localhost</em></strong> to the <strong><em>localhost:3000</em></strong>. </p>
  
  <p>However, the error occurred with <code>DELETE</code> and <code>PUT</code></p>
  
  <p>This is how i allow to cross domain access</p>
  
  <pre><code>class ApplicationController &lt; ActionController::Base
      protect_from_forgery
      before_filter :allow_cross_domain_access
      def allow_cross_domain_access
          response.headers["Access-Control-Allow-Origin"] = "*"
          response.headers["Access-Control-Allow-Methods"] = "*"
      end
  end
  </code></pre>
  
  <p>Any idea how to fix it?</p>