From f1878baad5e8f6bc49d1c37dd5afb917b79985f4 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Mon, 12 Dec 2016 20:28:39 +0900 Subject: :nail_care: Don't expect the caller of this method to know that the return value has an extra " " --- .../lib/rails/generators/rails/controller/controller_generator.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/generators/rails/controller/controller_generator.rb b/railties/lib/rails/generators/rails/controller/controller_generator.rb index ced3c85c00..4f60e44888 100644 --- a/railties/lib/rails/generators/rails/controller/controller_generator.rb +++ b/railties/lib/rails/generators/rails/controller/controller_generator.rb @@ -16,7 +16,7 @@ module Rails unless options[:skip_routes] actions.reverse_each do |action| # route prepends two spaces onto the front of the string that is passed, this corrects that. - route generate_routing_code(action)[2..-1] + route generate_routing_code(action) end end end @@ -40,7 +40,7 @@ module Rails # namespace :bar do namespace_ladder = regular_class_path.each_with_index.map do |ns, i| indent(" namespace :#{ns} do\n", i * 2) - end.join + end.join[2..-1] # Create route # get 'baz/index' -- cgit v1.2.3