ruby - How to serve fonts from public folder allowing "Access-Control-Allow-Origin" in rails? -
i have fonts folder in "public" folder. using font paths in css file like:
https://example.com/fonts/icomoon.eot?2p5wfs
i having issue:
from origin 'null' has been blocked cors policy: no 'access-control-allow-origin' header present on requested resource. origin 'null' therefore not allowed access.
it works if turn on chrome "cors" extension. how can load icons without using chrome extension?
try:
config.action_dispatch.default_headers = { 'access-control-allow-origin' => 'https://example.com', 'access-control-request-method' => %w{get post options}.join(",") }
Comments
Post a Comment