brynary/rack-bug

View on GitHub
lib/rack/bug/views/panels/request_variables.html.erb

Summary

Maintainability
Test Coverage
<% ["GET", "POST", "Session", "Cookies", "SERVER VARIABLES", "Rack ENV"].each do |header|
     next unless sections.has_key?(header)
%>
  <h3><%=header%></h3>
  <table id="request_variables">
    <thead>
      <tr>
        <th>Variable</th>
        <th>Value</th>
      </tr>
    </thead>
    <tbody>
      <% i = 1 %>
      <% sections[header].each do |key, val| %>
        <tr>
          <td><%=h key %></td>
          <td class="code"><div>
          <% if val.is_a?(Hash) %>
            <%=h val.inspect %>
          <% else %>
            <%=h val.to_s %>
          <% end %>
          </div></td>
        </tr>
        <% i += 1 %>
      <% end %>
    </tbody>
  </table>
<% end %>