App::Application.routes => App::Application.routes.draw

This commit is contained in:
Jesse Storimer 2010-02-06 01:58:55 +08:00 committed by Jeremy McAnally
parent 00a7255a88
commit 0a87d05430
2 changed files with 4 additions and 4 deletions

View File

@ -327,7 +327,7 @@ module Rails
r.to_route_code r.to_route_code
end.join("\n") end.join("\n")
"#{app_name.classify}::Application.routes do\n#{@new_code}\nend\n" "#{app_name.classify}::Application.routes.draw do\n#{@new_code}\nend\n"
end end
private private

View File

@ -40,7 +40,7 @@ class RoutesUpgraderTest < ActiveSupport::TestCase
end end
" "
new_routes_code = "MyApplication::Application.routes do new_routes_code = "MyApplication::Application.routes.draw do
match '/home' => 'home#index' match '/home' => 'home#index'
match '/login' => 'sessions#new', :as => :login match '/login' => 'sessions#new', :as => :login
resources :hats resources :hats
@ -101,7 +101,7 @@ end
end end
" "
new_routes_code = "MyApplication::Application.routes do new_routes_code = "MyApplication::Application.routes.draw do
match '/' => 'home#index' match '/' => 'home#index'
end end
" "
@ -122,7 +122,7 @@ end
end end
" "
new_routes_code = "MyApplication::Application.routes do new_routes_code = "MyApplication::Application.routes.draw do
match '/:controller(/:action(/:id))' match '/:controller(/:action(/:id))'
end end
" "