diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -62,13 +62,17 @@ module ActionDispatch
           raise ActionController::RoutingError, e.message, e.backtrace if default_controller
         end
 
-      private
+      protected
+
+        attr_reader :controller_class_names
 
         def controller_reference(controller_param)
-          const_name = @controller_class_names[controller_param] ||= "#{controller_param.camelize}Controller"
+          const_name = controller_class_names[controller_param] ||= "#{controller_param.camelize}Controller"
           ActiveSupport::Dependencies.constantize(const_name)
         end
 
+      private
+
         def dispatch(controller, action, req)
           controller.action(action).call(req.env)
         end
Move `controller_reference` and `controller_class_names` to protected
scope so that they are available to subclasses.