diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 8d51e82..c41fe13 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -323,7 +323,7 @@ module ActionController seen_paths = Hash.new {|h, k| h[k] = true; false} normalize_paths(paths).each do |load_path| - Dir["#{load_path}/**/*_controller.rb"].collect do |path| + Dir["#{load_path}/**/*_controller.rb"].sort_by { |path| - path.length }.collect do |path| next if seen_paths[path.gsub(%r{^\.[/\\]}, "")] controller_name = path[(load_path.length + 1)..-1]