Last active
September 28, 2015 12:48
-
-
Save celsodantas/1440798 to your computer and use it in GitHub Desktop.
Cross site access - Javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------- | |
PROBLEMA: | |
Permitir acesso ou requisição via jQuery entre dominios | |
--------------------- | |
SOLUÇÂO: | |
[rails / your controller ] | |
after_filter :set_access_control_headers | |
def set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Request-Method'] = '*' | |
end | |
--------------------- | |
FONTE: | |
http://blog.jetthoughts.com/2010/12/22/allow-multiple-access-control-requests-for-rails/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment