我正在尝试通过Carrierwave将文件上传到带有此Ajax帖子的Rails后端
$.ajax({
url: mypath
data: myformdata
contentType: false
processData: false
type: "POST"
})
我在请求资源上出现“No'Access-Control-Allow-Origin'标头”,因此出现500内部服务器错误。 所有其他请求都由Ember.js处理,并通过简单的auth-devise正常工作。 知道问题可能是什么吗?
提前感谢您的任何建议!
答案 0 :(得分:1)
您需要设置应用程序以在Rails后端使用CORS。
参见这些文章:
http://leopard.in.ua/2012/07/08/using-cors-with-rails/
https://demisx.github.io/rails-api/2014/02/18/configure-accept-headers-cors.html