Here is a cors demo on rails.