Rails 4和Jammit路由问题——不应该使用match



我已经升级到Rails 4.0.5,我正在使用Jammit 0.6.6。当启动服务器时,我得到一个错误:

/home/haimh/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.5/lib/action dispatch/routing/mapper.rb:191:in normalize_condition!:You should not use the match method in your router without specifying an HTTP method.

查看堆栈跟踪,我看到Jammit的路由。

除了在Jammit的路由中手动更新代码之外,还有什么方法可以解决这个问题吗?rb文件?

使用via

:

, via => [:get, :post]加到末尾

match ':controller(/:action(/:id))' , :controller=> /admin/[^/]+/, :via => [:get,:post]

如果你不想使用match,你必须把你的路由放在

resources :controller do
 get :action, :on => :collection
end

相关内容

最新更新