-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cannot perform update(PUT) action #44
Comments
@Bunthoeun This is because you need to set up routes that respond to the OPTIONS method. As you can see in the server log, it says::
Any time you see that kind of error, it means something is missing or is not set up correctly in your config/routes.rb file. Unfortunately, the fact that you need to set up a route that responds to OPTIONS is not documented in this repo, but I'm working on submitting a pull request that will add that much needed documentation. In the meantime, you can see how to do it here. |
@monfresh good idea on documenting that, I ran into that as well and some documentation would have helped |
I will work on the documentation in the next few days. |
Is it not a good idea to deal with the OPTIONs in rack-cors? Seems like an incomplete implementation if you need to add OPTION routes everywhere. |
Sorry - I just took a quick look at this. |
I'm having the same issue here. I am explicitly sending the header
|
I had a similar issue. My problem was the order of my middleware (mentioned in the README. As a result, I had to update the first line for my config definition, effectively bumping the Rack::Cors insertion to the top of my middleware stack.
Hope this helps you. |
Thanks @aaronromeo I managed to make my config work, it was my mistake, I had forgotten to include |
I believe this issue has been addressed by #106. Closing. |
I'm using Rails API(REST) with rack-cors. I can get record from server, but can't update.
Server Log:
Started OPTIONS "/sections?_dc=1394560533889&page=1&start=0&limit=25" for 127.0.0.1 at 2014-03-12 00:55:33 +0700
Started GET "/sections?_dc=1394560533889&page=1&start=0&limit=25" for 127.0.0.1 at 2014-03-12 00:55:34 +0700
Processing by SectionsController#index as /
Parameters: {"_dc"=>"1394560533889", "page"=>"1", "start"=>"0", "limit"=>"25"}
Section Load (0.5ms) SELECT A.*,B.name AS Page FROM sections AS A LEFT JOIN pages AS B ON A.page_id=B.id
Completed 200 OK in 191ms (Views: 5.9ms | ActiveRecord: 5.0ms)
Started OPTIONS "/sections/3?_dc=1394560545888" for 127.0.0.1 at 2014-03-12 00:55:45 +0700
ActionController::RoutingError (No route matches [OPTIONS] "/sections/3"):
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call
Any idea will be appreciate
The text was updated successfully, but these errors were encountered: