我有以下几条路线:
people GET /people(.:format) {:action=>"index", :controller=>"people"}
POST /people(.:format) {:action=>"create", :controller=>"people"}
new_person GET /people/new(.:format) {:action=>"new", :controller=>"people"}
edit_person GET /people/:id/edit(.:format) {:action=>"edit", :controller=>"people"}
person GET /people/:id(.:format) {:action=>"show", :controller=>"people"}
**PUT /people/:id(.:format) {:action=>"update", :controller=>"people"}**
DELETE /people/:id(.:format) {:action=>"destroy", :controller=>"people"}但是,当我的flex客户端使用
" **<mx:HTTPService id = "update"
url='http://localhost:3000/people/{grid.selectedItem.id}.xml?_method=put**" 我得到了错误
**ActionController::RoutingError (No route matches "/people/1.xml"**. 即使我显式地(为了故障排除)将行转换为**url='http://localhost:3000/people/1.xml?_method=put",错误仍然存在。*
我可以在地址栏中键入"http://localhost:3000/people/1.xml"而不会出错。
我做错了什么?提前谢谢。
发布于 2011-08-15 22:57:05
当您键入http://localhost:3000/people/1.xml时,它是GET request。
您需要发出一个实际为POST http://localhost:3000/people/1.xml?_method=PUT的PUT请求
因此您需要以某种方式从Flex发出POST请求
https://stackoverflow.com/questions/7066367
复制相似问题