Ruby on Rails Friday, November 30, 2012

im reading through the topic above and trying to apply it to my app.
as reference i found:

my prob is that i dont see the 'preflight', meaning the first request
prior the actual post, which should(?) deliver this:

the js code look like this:
type: 'POST',
dataType: "json",
crossDomain: true,
url: "http://someserver/foo.json",
data: {test:999},

in application_controller.rb i have this in a before filter:
def cors
p "calling - CORS"
p request.request_method #<< this is "POST" instead of the expected OPTIONS
p request.headers["HTTP_ORIGIN"] #<< this is http://localhost
from which im posting
head(:ok) if true # request.request_method == "OPTIONS"
also in the browser inspection i see only the actual post, not the
preflight request sending the OPTIONS.

am i on a wrong track here?


You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit

No comments:

Post a Comment