Follow by this question How to set access-control-allow-origin in webrick under rails?, I can GET
and POST
from the localhost to the localhost:3000.
However, the error occurred with DELETE
and PUT
This is how i allow to cross domain access
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :allow_cross_domain_access
def allow_cross_domain_access
response.headers["Access-Control-Allow-Origin"] = "*"
response.headers["Access-Control-Allow-Methods"] = "*"
end
end
Any idea how to fix it?