Skip to content

Commit

Permalink
Show installed middleware in builtin rails info (/rails/info/properti…
Browse files Browse the repository at this point in the history
…es) [#2396 state:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information
mschuerig authored and josh committed Apr 2, 2009
1 parent ea8077c commit cad3e8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 10 additions & 1 deletion railties/builtin/rails_info/rails/info.rb
Expand Up @@ -56,7 +56,12 @@ def to_html
returning table = '<table>' do
properties.each do |(name, value)|
table << %(<tr><td class="name">#{CGI.escapeHTML(name.to_s)}</td>)
table << %(<td class="value">#{CGI.escapeHTML(value.to_s)}</td></tr>)
formatted_value = if value.kind_of?(Array)
"<ul>" + value.map { |v| "<li>#{CGI.escapeHTML(v.to_s)}</li>" }.join + "</ul>"
else
CGI.escapeHTML(value.to_s)
end
table << %(<td class="value">#{formatted_value}</td></tr>)
end
table << '</table>'
end
Expand Down Expand Up @@ -102,6 +107,10 @@ def git_info
end
end

property 'Middleware' do
ActionController::Dispatcher.middleware.active.map(&:inspect)
end

# The Rails Git revision, if it's checked out into vendor/rails.
property 'Edge Rails revision' do
edge_rails_revision
Expand Down
7 changes: 6 additions & 1 deletion railties/html/index.html
Expand Up @@ -99,7 +99,12 @@
}
#about-content td.name {color: #555}
#about-content td.value {color: #000}


#about-content ul {
padding: 0;
list-style-type: none;
}

#about-content.failure {
background-color: #fcc;
border: 1px solid #f00;
Expand Down

0 comments on commit cad3e8b

Please sign in to comment.