Supporting Cross-Domain AJAX in Rails using JSONP and CORS
blog.carbonfive.com