【发布时间】:2010-07-18 18:20:39
【问题描述】:
所以我的一条路线出现此错误。我正在运行 Rails v2.3.8 + Mongrel 1.1.5。 Rails 只支持 GET 和 POST 吗?
ActionController::MethodNotAllowed (Only get and post requests are allowed.):
我的 routes.rb 中定义的路由是 -
map.connect "#{base_url}/r/:id/rate?v=:value&u=:user_id", :conditions => { :method => :put }, :controller => 'mycontroller', :action => 'myaction'
【问题讨论】:
-
不,Rails 支持所有标准 HTTP 方法(GET POST PUT DELETE)。显示其余的 routes.rb - 它可能会走错路线。
标签: ruby-on-rails rest http-method