aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-01-31 00:07:51 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-01-31 00:13:10 +0530
commitcc88fcfe39afa45679150ffb3f516a5936b41b97 (patch)
tree83591474a77d5e52d34fee67e4c55d27920146a9 /railties/lib
parenta0ff270ee1fa677a18c8532c3c5ae32c2f4ffa13 (diff)
downloadrails-cc88fcfe39afa45679150ffb3f516a5936b41b97.tar.gz
rails-cc88fcfe39afa45679150ffb3f516a5936b41b97.tar.bz2
rails-cc88fcfe39afa45679150ffb3f516a5936b41b97.zip
Fixes #4764 - remove generated new line in routes.rb on scaffold generation
As explained in #4764, when destroying a scaffold, routes.rb loses a new line. This seems to happen because a new line is added while generating the route and the destroy generator removes it. However, this causes a problem if the routes file is manually edited to remove such new lines. This commit just removes that extra new line from added in the first place.
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/generators/actions.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb
index 45f55a2a0a..32793b1a70 100644
--- a/railties/lib/rails/generators/actions.rb
+++ b/railties/lib/rails/generators/actions.rb
@@ -246,7 +246,7 @@ module Rails
sentinel = /\.routes\.draw do\s*$/
in_root do
- inject_into_file 'config/routes.rb', "\n #{routing_code}\n", { :after => sentinel, :verbose => false }
+ inject_into_file 'config/routes.rb', "\n #{routing_code}", { :after => sentinel, :verbose => false }
end
end