以下是我在Rails2中的一些路线,我想升级到Rails3:
map.callback "/auth/:provider/callback", :controller => "authorizations", :action => "create" #omniauth
map.failure "/auth/failure", :controller => "authorizations", :action => "failure" #omniauth
map.signup 'signup', :controller => 'users', :action => 'new'
map.signin 'signin', :controller => 'user_sessions', :action => 'new'
map.signout 'signout', :controller => 'user_sessions', :action => 'destroy'
match "/auth/:provider/callback" => "authorizations#create", :as => :callback
match "/auth/failure" => "authorizations#failure", :as => :failure
match "signup" => "users#new", :as => :signup
match "signin" => "user_sessions#new", :as => :signin
match "signout" => "user_sessions#destroy", :as => :signout
这应该会让你继续前进。
我肯定会查看apneadiving
提到的屏幕截图以及Rails的路线。
查看rails_upgrade插件https://github.com/rails/rails_upgrade及其CCD_ 2。
script/plugin install git://github.com/rails/rails_upgrade.git
rake rails:upgrade:routes
这将获取您当前的路由文件,并使用Rails3语法对其进行重写。在阅读了其他一些答案中的文档后,复制控制台输出并查找任何潜在的优化。
这应该会回答并让您学习:
http://railscasts.com/episodes/203-routing-in-rails-3
您还可以在Rails Routing from the Outside In中找到许多很棒的信息。