diff options
author | José Valim <jose.valim@gmail.com> | 2010-03-22 21:06:03 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-03-22 21:07:37 +0100 |
commit | e8a80cdded7d4a3ecf8d125681ab8bcae2b91504 (patch) | |
tree | 21b73133d685292d6ae96a1da6614e9dde8927e6 | |
parent | 4998e097cc597f26cbe292552bcf5608b87cb1d2 (diff) | |
download | rails-e8a80cdded7d4a3ecf8d125681ab8bcae2b91504.tar.gz rails-e8a80cdded7d4a3ecf8d125681ab8bcae2b91504.tar.bz2 rails-e8a80cdded7d4a3ecf8d125681ab8bcae2b91504.zip |
Controller generators should use routes shortcut.
-rw-r--r-- | railties/lib/generators/rails/controller/controller_generator.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/controller_generator_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/generators/rails/controller/controller_generator.rb b/railties/lib/generators/rails/controller/controller_generator.rb index 5d2e36b499..9788c0d0bc 100644 --- a/railties/lib/generators/rails/controller/controller_generator.rb +++ b/railties/lib/generators/rails/controller/controller_generator.rb @@ -10,7 +10,7 @@ module Rails def add_routes actions.reverse.each do |action| - route %{get "/#{file_name}/#{action}" => "#{file_name}##{action}"} + route %{get "#{file_name}/#{action}"} end end diff --git a/railties/test/generators/controller_generator_test.rb b/railties/test/generators/controller_generator_test.rb index 8434a44ed2..2251622e02 100644 --- a/railties/test/generators/controller_generator_test.rb +++ b/railties/test/generators/controller_generator_test.rb @@ -55,7 +55,7 @@ class ControllerGeneratorTest < Rails::Generators::TestCase def test_add_routes run_generator - assert_file "config/routes.rb", /get "\/account\/foo" => "account#foo"/, /get "\/account\/bar" => "account#bar"/ + assert_file "config/routes.rb", /get "account\/foo"/, /get "account\/bar"/ end def test_invokes_default_template_engine_even_with_no_action |