title: Heroku Rails CORS issue
body: <p>I have built a rails restful service that I host on Heroku and a Angular client which I am trying to run from my local machine. Eventually this client will be run added to a phonegap project. However, for now i'm testing the application in chrome and ie and my browser keeps returning the error below. </p>
  
  <pre><code>XMLHttpRequest cannot load  Origin http://localhost is not allowed by Access-Control-Allow-Origin. 
  </code></pre>
  
  <p>This is the error message that I get. I was faced with this issue before pushing to Heroku and resolved it by adding adding access headers to my responses. </p>
  
  <pre><code>    after_filter :cors_set_access_control_headers
  
  # For all responses in this controller, return the CORS access control headers.
  
  def cors_set_access_control_headers
          headers['Access-Control-Allow-Origin'] = 'http://localhost' #*
          headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'
          headers['Access-Control-Allow-Headers'] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(',')
          headers['Access-Control-Max-Age'] = "1728000"
  end
  </code></pre>
  
  <p>This does not seem to work. For some reason this isn't working with Heroku. Does anyone know how to solve this issue?</p>