<% content_for :javascript_includes do %>
  <%= javascript_include_tag "jquery.dataTables.min.js" %>
  <script type="text/javascript">
    $(document).ready(function(){
        $('#results-table').DataTable();
    });
  </script>
<% end %>

<table class="table table-striped table-condensed table-bordered" id="results-table">
  <thead>
    <tr class="info">
      <td colspan="<%= @headers.size %>">Results for '<%= link_to(@task.measurable.name, @task.measurable) %>' on <%= link_to(@task.repository.name, @task.repository) %></td>
    </tr>
    <tr>
      <% @headers.each do |key|%>
        <th>
          <%= key %>
        </th>
      <% end %>
    </tr>
  </thead>
  <tbody>
  <% @results.each do |res_row| %>
    <tr>
      <% @headers.each do |header|%>
      <td>
        <%= res_row[header] =~ URI::regexp ? link_to(res_row[header]) : res_row[header] %>
      </td>
      <% end %>
    </tr>
  <% end %>
  </tbody>
</table>
<% content_for :javascript_includes do %>
  <%= javascript_include_tag "jquery.dataTables.min.js" %>
  <script type="text/javascript">
    $(document).ready(function(){
        $('#results-table').DataTable();
    });
  </script>
<% end %>

<table class="table table-striped table-condensed table-bordered" id="results-table">
  <thead>
    <tr class="info">
      <td colspan="<%= @headers.size %>">Results for '<%= link_to(@task.measurable.name, @task.measurable) %>' on <%= link_to(@task.repository.name, @task.repository) %></td>
    </tr>
    <tr>
      <% @headers.each do |key|%>
        <th>
          <%= key %>
        </th>
      <% end %>
    </tr>
  </thead>
  <tbody>
  <% @results.each do |res_row| %>
    <tr>
      <% @headers.each do |header|%>
      <td>
        <%= res_row[header] =~ URI::regexp ? link_to(res_row[header], res_row[header]) : res_row[header] %>
      </td>
      <% end %>
    </tr>
  <% end %>
  </tbody>
</table>
Make stuff clickable in the results and send people to the real results
Make stuff clickable in the results and send people to the real results
