gist JS

Thursday, September 11, 2014

CORS for Rails / Heroku & Cloudfront (for dummies)

So starting today all your fonts don't load. Because CORS.

No 'Access-Control-Allow-Origin' header is present on the requested resource.

Here's what to do.

1) Remember your CloudFront password.

2) Edit your behavior


3) Forwarding headers -> whitelist

4) Add "Origin"

5) Add rack-cors to Gemfile

gem 'rack-cors'

6) Add stuff to config.ru

require 'rack/cors'
use Rack::Cors do

  # allow all origins in development
  allow do
    origins '*'
    resource '*',
        :headers => :any,
        :methods => [:get, :post, :delete, :put, :options]

7) Deploy

8) Try to forget about CORS

Did that work? Why not try my tool ForceRank.it, a prioritization tool for product teams that lets you rank choices. It even lets you import a Trello board!


sunitha vishnu said...

This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai

Karthik said...

It's very useful to read your article in this blog and very informative to develop my skills and for the career
iOS Training in Chennai
iOS Training Institute in Chennai
iOS Course in Chennai
mobile application development training in chennai
iOS Training

Kayal m said...

Great work! Really I enjoy to read your content and very helpful for improving myself. Keep blogging...
Pega Training in Chennai
Pega Course in Chennai
Oracle Training in Chennai
Oracle DBA Training in Chennai
Excel Training in Chennai
Embedded System Course Chennai
Tableau Training in Chennai
Unix Training in Chennai
Power BI Training in Chennai

sheela rajesh said...

Awesome informations that you have shared for us.I eagerly waiting for more updates in future.
Hadoop Training in Chennai
Big data training in chennai
hadoop training in velachery
JAVA Training in Chennai
Python Training in Chennai
Selenium Training in Chennai
Hadoop training in chennai
Big data training in chennai
big data course in chennai

janakikrishnan said...

The information mentioned in the blog is true and useful to freshers. Keep going.
AWS Training in Bangalore
AWS Course in Bangalore
Best AWS Training in Bangalore
AWS Training Institutes in Bangalore
AWS Certification Training in Bangalore
AWS Training Center in Bangalore

Vicky Ram said...

The blog shares a lot of worthy things. Keep going..

Article submission sites