aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2013-01-18 13:46:46 -0800
committerGuillermo Iguaran <guilleiguaran@gmail.com>2013-01-18 13:46:46 -0800
commit5da8491e9f5daa5915410dc891b06172f295929c (patch)
treef2205877d945ea60c12cc84072d335f63646df51
parent40e797827935756aacf0463e4b44e1c1c92b0aeb (diff)
parentf654c3cfc00271c3b410bc0fe9c80a5593709c02 (diff)
downloadrails-5da8491e9f5daa5915410dc891b06172f295929c.tar.gz
rails-5da8491e9f5daa5915410dc891b06172f295929c.tar.bz2
rails-5da8491e9f5daa5915410dc891b06172f295929c.zip
Merge pull request #8995 from schneems/schneems/formatting-the-formatters
Remove "Application" section title from routes
-rw-r--r--actionpack/lib/action_dispatch/routing/inspector.rb19
1 files changed, 13 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/routing/inspector.rb b/actionpack/lib/action_dispatch/routing/inspector.rb
index ea3e8357d4..474d43cd67 100644
--- a/actionpack/lib/action_dispatch/routing/inspector.rb
+++ b/actionpack/lib/action_dispatch/routing/inspector.rb
@@ -73,10 +73,11 @@ module ActionDispatch
routes_to_display = filter_routes(filter)
routes = collect_routes(routes_to_display)
- formatter.section :application, 'Application routes', routes
+ formatter.section routes
@engines.each do |name, engine_routes|
- formatter.section :engine, "Routes for #{name}", engine_routes
+ formatter.section_title "Routes for #{name}"
+ formatter.section engine_routes
end
formatter.result
@@ -125,8 +126,11 @@ module ActionDispatch
@buffer.join("\n")
end
- def section(type, title, routes)
- @buffer << "\n#{title}:" unless type == :application
+ def section_title(title)
+ @buffer << "\n#{title}:"
+ end
+
+ def section(routes)
@buffer << draw_section(routes)
end
@@ -148,8 +152,11 @@ module ActionDispatch
@buffer = []
end
- def section(type, title, routes)
- @buffer << %(<tr><th colspan="4">#{title}</th></tr>)
+ def section_title(title)
+ @buffer << "<tr><th colspan="4">#{title}</th></tr>"
+ end
+
+ def section(routes)
@buffer << @view.render(partial: "routes/route", collection: routes)
end