diff options
author | Arthur Neves <arthurnn@gmail.com> | 2015-03-18 10:27:55 -0400 |
---|---|---|
committer | Arthur Neves <arthurnn@gmail.com> | 2015-03-18 10:33:59 -0400 |
commit | 2f23f97b2e58ddb13af30d12c149e55d610a8a26 (patch) | |
tree | a3a7d1b05f778a6d6e5d594ca48839108999186f /railties/lib/rails/generators/rails | |
parent | 4df806f95f8c64c8a1406aebf5f82807ff76c611 (diff) | |
download | rails-2f23f97b2e58ddb13af30d12c149e55d610a8a26.tar.gz rails-2f23f97b2e58ddb13af30d12c149e55d610a8a26.tar.bz2 rails-2f23f97b2e58ddb13af30d12c149e55d610a8a26.zip |
Add a new-line to the end of route method generated code.
Fix regression on route method that was added by
bac812a7ef2660a2fe2ab00822e5e66228379822. The regression was that when
calling the `route` method, we were not appending a \n anymore.
[fixes #19316]
Diffstat (limited to 'railties/lib/rails/generators/rails')
-rw-r--r-- | railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb b/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb index e4a2bc2b0f..c986f95e67 100644 --- a/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb +++ b/railties/lib/rails/generators/rails/resource_route/resource_route_generator.rb @@ -29,8 +29,10 @@ module Rails write("end", route_length - index) end - # route prepends two spaces onto the front of the string that is passed, this corrects that - route route_string[2..-1] + # route prepends two spaces onto the front of the string that is passed, this corrects that. + # Also it adds a \n to the end of each line, as route already adds that + # we need to correct that too. + route route_string[2..-2] end private |