How to set access-control-allow-origin in webrick under rails?

Posted by brad on Stack Overflow See other posts from Stack Overflow or by brad
Published on 2010-03-29T02:18:00Z Indexed on 2010/03/29 2:23 UTC
Read the original article Hit count: 566

I have written a small rails app to serve up content to another site via xmlhttprequests that will be operating from another domain (it will not be possible to get them running on the same server). I understand I will need to set access-control-allow-origin on my rails server to allow the requesting web page to access this material.

It seems fairly well documented how to do this with Apache and this is probably the server I will use once I deploy the site. While I am developing though I hope to just use webrick as I am used to doing with rails. Is there a way of configuring webrick to provide the appropriate http header within rails?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about xmlhttprequest