From 37d9c44b6d15cc0b02f327fe51687db7d0443bb8 Mon Sep 17 00:00:00 2001 From: schneems Date: Mon, 17 Dec 2012 14:26:46 -0600 Subject: Format routes as html on debug page When someone gets a routing exception, the routes are rendered (starting in Rails 4.0). This PR brings parity between the html routes in the `rails/info/routes` path and when rendered from an exception. This is the continuation of #8521 which brought html formatted routes. In addition to bringing parity to the two views, we're keeping our views DRY by rendering off of the same partials. In this case Railties depends on partials provided by ActionDispatch. I'm open to alternative implementations. Ideally both views will use the same code so any improvements or updates to it will be reproduced on both.
![](http://f.cl.ly/items/3O1D0K1v0j0i343O3T3T/Screen%20Shot%202012-12-17%20at%203.07.20%20PM.png) --- actionpack/lib/action_dispatch/middleware/debug_exceptions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/middleware/debug_exceptions.rb') diff --git a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb index f356c2a85c..1dc51d62e0 100644 --- a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb @@ -87,7 +87,7 @@ module ActionDispatch return false unless @routes_app.respond_to?(:routes) if exception.is_a?(ActionController::RoutingError) || exception.is_a?(ActionView::Template::Error) inspector = ActionDispatch::Routing::RoutesInspector.new - inspector.format(@routes_app.routes.routes).join("\n") + inspector.collect_routes(@routes_app.routes.routes) end end end -- cgit v1.2.3