简体   繁体   English

Rails2到Rails3的路由转换

[英]Rails2 to Rails3 routing conversion

Routing makes zero sense to me, is there an easy way to convert this: 路由对我来说意义为零,有没有简单的方法可以将其转换为:

#map.resources :bicycles, :controller => 'store/bicycles', :path_prefix => 'store'

thanks in advance 提前致谢

The controller option is also available in Rails 3 and the path_prefix can be achieved with scope . controller选项在Rails 3中也可用,并且path_prefix可以通过scope实现。 The below is the conversion of the route to Rails 3 以下是路线到Rails 3的转换

scope 'store' do
  resources :bicycles, :controller => 'store/bicycles'
end

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM