I’m using FLEX 3 to make XML request to Rails 3. Since FLEX 3 only offers POST and GET, I have to use the “?_method=PUT” hack to maintain proper RESTfulness:
http://127.0.0.1:3000/locator/locator_users/1.xml?_method=PUT
On the server side its showing up as a POST and I’m getting an ActionController::RoutingError (No Route Matches).
I did a rake routes and the route is there, properly namespaced and all.
This worked fine with Rails 2, so I have reason to believe it must be Rails 3 that changed. After doing some searching, people seemed to have indicated that it should still work. But, it’s not for me. Can anyone confirm or deny Rails 3 compatibility?
UPDATE
OK, after some more tinkering, I think this is actually a problem of Flash Player 10. Flash PLayer 9 seems to work fine with “_method=” hack, 10 does not. See this new post I wrote (Flash Player 9 vs Flash Player 10 with FLEX 3, ?_method=PUT/DELETE not working?).
Partly this is due to
Rack::MethodOverride‘s behavior. It does not check the query params for_method, so a call tohttp://127.0.0.1:3000/locator/locator_users/1.xml?_method=PUT
will not get overridden properly due to that.I wrote a piece of Rack middleware that replaces it to fix this particular issue.
All you have to do is
add it to the
Gemfileswap Rack::MethodOverride out in
config/environment.rb