Finally got CORS working with AngularJS and the Rails JSON API