Rails2到Rails3的路由转换

时间:2015-10-07 03:46:39

标签: ruby-on-rails ruby-on-rails-3

路由对我来说没有任何意义,有一种简单的方法可以转换它:

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

提前致谢

1 个答案:

答案 0 :(得分:1)

Rails 3中也提供了controller选项,path_prefix可以实现scope。以下是将路线转换为 Rails 3

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