【发布时间】:2014-03-29 10:15:04
【问题描述】:
我在 rails 2.3.14 中有这条路线,我想将其转换为 rails 4.0.3
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
我尝试使用匹配,但给我错误。
【问题讨论】:
-
你尝试了什么,错误是什么?
-
匹配':controller/:action/:id' 匹配':controller/:action/:id.:format'
-
gems/actionpack-4.0.3/lib/action_dispatch/routing/mapper.rb:191:in
normalize_conditions!': You should not use thematch` 方法在您的路由器中没有指定 HTTP 方法。 (RuntimeError) 如果你想将你的动作暴露给 GET 和 POST,添加via: [:get, :post]选项。如果您想将您的操作公开给 GET,请在路由器中使用get:而不是:匹配“controller#action”做:获取“controller#action”
标签: ruby-on-rails routes migrate