I have a feature spec, as part of the page load. I hit a local url to get more data.
i.e. using http://fullcalendar.io/ which loads it's events via ajax
events: {
url: 'calendar_events.json',
type: 'GET',
error: function(response) {
...
}},
I am getting
XMLHttpRequest cannot load http://localhost:3000/calendar_events.json?start=2014-01-20&end=2014-01-27. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 404.
Not exactly sure how to resolve. I tried adding
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'
response.headers['Access-Control-Request-Method'] = '*'
response.headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
To a before_filter on my application controller just to see, but still get same issue.
NOTE: I am using capybara-webkit