Ember-Simple-Auth

Im trying to make a cors ember app with ember-simple-auth plugin and a basic rails setup. My ember app is on localhost:8000 and my rails api is on port 3000. Im following the examples and i keep getting this error:

XMLHttpRequest cannot load ‘http://localhost:3000/api/session’. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:8000’ is therefore not allowed access.

If anyone knows what this is or has a working rails 4 ember cors example i appreciate it.

I think you can refer to this link Access-Control-Allow-Origin

im not sure im following your recomendation

This example application I built for our workshops doesn’t use authentication or Ember-Simple-Auth but it is running on a Ruby on Rails 4 backend with CORS. So if you are interested take a look:

https://github.com/edgycircle/emberjs-workshop-oktober-2013
https://github.com/edgycircle/emberjs-workshop-oktober-2013-api

I recommend using rack-cors gem for this. It saved me a lot of funny code in my application controller :wink:

2 Likes