Skip to content

Commit cad3e8b

Browse files
mschuerigjosh
authored andcommitted
Show installed middleware in builtin rails info (/rails/info/properties) [rails#2396 state:resolved]
Signed-off-by: Joshua Peek <[email protected]>
1 parent ea8077c commit cad3e8b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

railties/builtin/rails_info/rails/info.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ def to_html
5656
returning table = '<table>' do
5757
properties.each do |(name, value)|
5858
table << %(<tr><td class="name">#{CGI.escapeHTML(name.to_s)}</td>)
59-
table << %(<td class="value">#{CGI.escapeHTML(value.to_s)}</td></tr>)
59+
formatted_value = if value.kind_of?(Array)
60+
"<ul>" + value.map { |v| "<li>#{CGI.escapeHTML(v.to_s)}</li>" }.join + "</ul>"
61+
else
62+
CGI.escapeHTML(value.to_s)
63+
end
64+
table << %(<td class="value">#{formatted_value}</td></tr>)
6065
end
6166
table << '</table>'
6267
end
@@ -102,6 +107,10 @@ def git_info
102107
end
103108
end
104109

110+
property 'Middleware' do
111+
ActionController::Dispatcher.middleware.active.map(&:inspect)
112+
end
113+
105114
# The Rails Git revision, if it's checked out into vendor/rails.
106115
property 'Edge Rails revision' do
107116
edge_rails_revision

railties/html/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@
9999
}
100100
#about-content td.name {color: #555}
101101
#about-content td.value {color: #000}
102-
102+
103+
#about-content ul {
104+
padding: 0;
105+
list-style-type: none;
106+
}
107+
103108
#about-content.failure {
104109
background-color: #fcc;
105110
border: 1px solid #f00;

0 commit comments

Comments
 (0)