Upgrade routes.rb from Rails 2 to Rails 3
,\s:controller\s=>\s['"](.*)['"]\s,\s:action\s=>\s['"](.*)['"]
=>
"$1#$2"
map.connect(.*),\s:conditions\s=>\s{\s:method\s=>\s:get\s}
=>
get$1
The official way is with this plugin
https://github.com/rails/rails_upgrade
But it is outdated, and upon extracting the routing upgrade script, the output is not usable and still requires manual attention.
What's cool in the new Rails is that you can display your routes :
$> bundle exec rake routes
Prefix Verb URI Pattern Controller#Action
root GET / user_sessions#new
account POST /account(.:format) users#create
new_account GET /account/new(.:format) users#new
edit_account GET /account/edit(.:format) users#edit
(...)
login GET /login(.:format) user_sessions#new
confirm GET /confirm(.:format) user_sessions#confirm
recettes GET /recettes(.:format) recettes#index
recette_new GET /recette/new(.:format) recettes#new_recette
POST|PUT /recette/new(.:format) recettes#create_recette
GET /recette/:id(.:format) recettes#recette {:id=>/[0-9]+/}
GET /recette/:id/edit(.:format) recettes#edit_recette {:id=>/[0-9]+/}
POST|PUT /recette/:id/edit(.:format) recettes#update_recette {:id=>/[0-9]+/}
reseller_my_products GET /reseller/my_products(.:format) reseller#my_products
Recent Comments