提交 cc88fcfe 编写于 作者: V Vijay Dev

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.
上级 a0ff270e
......@@ -246,7 +246,7 @@ def route(routing_code)
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册