Skip to content
This repository
Browse code

Show installed middleware in builtin rails info (/rails/info/properti…

…es) [#2396 state:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information...
commit cad3e8b261a8d9551bc19a57007acf574d957548 1 parent ea8077c
Michael Schuerig authored April 02, 2009 josh committed April 02, 2009
11  railties/builtin/rails_info/rails/info.rb
@@ -56,7 +56,12 @@ def to_html
56 56
         returning table = '<table>' do
57 57
           properties.each do |(name, value)|
58 58
             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>)
60 65
           end
61 66
           table << '</table>'
62 67
         end
@@ -102,6 +107,10 @@ def git_info
102 107
       end
103 108
     end
104 109
 
  110
+    property 'Middleware' do
  111
+      ActionController::Dispatcher.middleware.active.map(&:inspect)
  112
+    end
  113
+
105 114
     # The Rails Git revision, if it's checked out into vendor/rails.
106 115
     property 'Edge Rails revision' do
107 116
       edge_rails_revision
7  railties/html/index.html
@@ -99,7 +99,12 @@
99 99
       }
100 100
       #about-content td.name  {color: #555}
101 101
       #about-content td.value {color: #000}
102  
-      
  102
+
  103
+      #about-content ul {
  104
+        padding: 0;
  105
+        list-style-type: none;
  106
+      }
  107
+
103 108
       #about-content.failure {
104 109
         background-color: #fcc;
105 110
         border: 1px solid #f00;

0 notes on commit cad3e8b

Please sign in to comment.
Something went wrong with that request. Please try again.