pboling/rack-insight

View on GitHub
lib/rack/insight/views/request_fragment.html.erb

Summary

Maintainability
Test Coverage
<div id="request_<%=request_id%>">
  <% panels.each do |panel| %>
    <% if panel.has_content? %>
      <div class="panel_content" id="<%= panel.camelized_name %>Panel">
        <div class="panel_controls">
          <form action="#">
            <select class="request_id_menu" name="current_request">
              <% requests.sort{|l,r| r[:id] <=> l[:id]}.each do |request| %>
                <option value="<%= request[:id] %>" <%= request[:id] == request_id ? "selected" : "" %>>
                <%= request[:id] %>: <%= request[:method] %> <%= request[:path] %>
                </option>
              <% end %>
            </select>
          </form>
          <a href="" class="rack-insight_close">Close</a>
        </div>
        <% begin %>
          <%=  panel.content_for_request(request_id) %>
        <% rescue StandardError => ex %>
          <%= "Error #{ex.class.name}: #{ex.message} <!-- #{ex.backtrace.join("\n")} -->" %>
        <% end %>
      </div>
    <% end %>
  <% end %>
</div>