diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-12-21 20:15:27 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-12-21 20:15:27 -0600 |
commit | 426348b48403f664cc10e8ec545b640e56c1c090 (patch) | |
tree | abbcac7646f0dba168a5685ee646c3e7f90d8e66 /railties/lib | |
parent | 36624b2c709925bcabb49d12082b9dd9d28c4c5c (diff) | |
download | rails-426348b48403f664cc10e8ec545b640e56c1c090.tar.gz rails-426348b48403f664cc10e8ec545b640e56c1c090.tar.bz2 rails-426348b48403f664cc10e8ec545b640e56c1c090.zip |
Update routes.rb template to use App name
Diffstat (limited to 'railties/lib')
4 files changed, 9 insertions, 5 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 498fd6a723..4e21287496 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -41,6 +41,10 @@ module Rails end end + def routes + ActionController::Routing::Routes + end + def call(env) new.call(env) end diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index 2efdf29127..f95b15acce 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -273,7 +273,7 @@ module Rails # def route(routing_code) log :route, routing_code - sentinel = "ActionController::Routing::Routes.draw do |map|" + sentinel = "routes.draw do |map|" in_root do inject_into_file 'config/routes.rb', "\n #{routing_code}\n", { :after => sentinel, :verbose => false } diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index ae18fa843b..b8f2911021 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -62,9 +62,9 @@ module Rails::Generators empty_directory "config" inside "config" do - copy_file "routes.rb" - template "application.rb" - template "environment.rb" + template "routes.rb" + template "application.rb" + template "environment.rb" directory "environments" directory "initializers" diff --git a/railties/lib/rails/generators/rails/app/templates/config/routes.rb b/railties/lib/rails/generators/rails/app/templates/config/routes.rb index 0d1b6bab4f..1959d3387f 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/routes.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/routes.rb @@ -1,4 +1,4 @@ -ActionController::Routing::Routes.draw do |map| +<%= app_const %>.routes.draw do |map| # The priority is based upon order of creation: # first created -> highest priority. |