Ruby on rails RubyonRails路由问题
我有以下路线:Ruby on rails RubyonRails路由问题,ruby-on-rails,ruby,apache-flex,ruby-on-rails-3,Ruby On Rails,Ruby,Apache Flex,Ruby On Rails 3,我有以下路线: people GET /people(.:format) {:action=>"index", :controller=>"people"} POST /people(.:format) {:action=>"create", :controller=>"people"} new_person GET /people/new(.:format) {:actio
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**"
即使我明确地(为了排除故障)将该行转换为**url=http://localhost:3000/people/1.xml?_method=put“
错误仍然存在*
我可以键入”http://localhost:3000/people/1.xml“
在地址栏中,无错误
我做错了什么?请提前感谢。当您键入
http://localhost:3000/people/1.xml
这是GET请求
您需要发出一个PUT
请求,实际上是POST?\u method=PUT
因此,您需要以某种方式从Flex发出
POST
请求,该请求看起来像是基于@Jibaly的机架中的一个bug。以前的解决方案似乎部分不起作用,因为config/environment.rb中的中间件交换会导致一个错误:“undefined variable“谢谢你的及时回复。flex调用的全文如下:如您所见,它是一个POST请求。
**ActionController::RoutingError (No route matches "/people/1.xml"**.