lib/rails/generators/actions.rb in railties-4.1.9 vs lib/rails/generators/actions.rb in railties-4.1.10.rc1

- old
+ new

@@ -216,13 +216,13 @@ # Make an entry in Rails routing file <tt>config/routes.rb</tt> # # route "root 'welcome#index'" def route(routing_code) log :route, routing_code - sentinel = /\.routes\.draw do\s*$/ + sentinel = /\.routes\.draw do\s*\n/m in_root do - inject_into_file 'config/routes.rb', "\n #{routing_code}", { after: sentinel, verbose: false } + inject_into_file 'config/routes.rb', " #{routing_code}", { after: sentinel, verbose: false, force: true } end end # Reads the given file at the source root and prints it in the console. #