diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/generators/erb/controller/controller_generator.rb | 5 | ||||
-rw-r--r-- | railties/test/generators/controller_generator_test.rb | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/railties/lib/generators/erb/controller/controller_generator.rb b/railties/lib/generators/erb/controller/controller_generator.rb index a8bbcf401c..d78bcba1b8 100644 --- a/railties/lib/generators/erb/controller/controller_generator.rb +++ b/railties/lib/generators/erb/controller/controller_generator.rb @@ -10,8 +10,9 @@ module Erb empty_directory base_path actions.each do |action| - @action, @path = action, File.join(base_path, action) - template filename_with_extensions(:view), filename_with_extensions(@path) + @action = action + @path = filename_with_extensions(File.join(base_path, action)) + template filename_with_extensions(:view), @path end end end diff --git a/railties/test/generators/controller_generator_test.rb b/railties/test/generators/controller_generator_test.rb index 14773373af..8434a44ed2 100644 --- a/railties/test/generators/controller_generator_test.rb +++ b/railties/test/generators/controller_generator_test.rb @@ -49,8 +49,8 @@ class ControllerGeneratorTest < Rails::Generators::TestCase def test_invokes_default_template_engine run_generator - assert_file "app/views/account/foo.html.erb", /app\/views\/account\/foo/ - assert_file "app/views/account/bar.html.erb", /app\/views\/account\/bar/ + assert_file "app/views/account/foo.html.erb", %r(app/views/account/foo\.html\.erb) + assert_file "app/views/account/bar.html.erb", %r(app/views/account/bar\.html\.erb) end def test_add_routes |