BathHacked/energy-sparks

View on GitHub
app/views/admin/schools/removals/index.html.erb

Summary

Maintainability
Test Coverage
<h1>Schools that have been removed</h1>

<table class="table table-striped">
  <thead>
    <tr>
      <th>Name</th>
      <th>Archived?</th>
      <th>Archived date</th>
      <th>Removal date</th>
      <th>Meters</th>
    </tr>
  </thead>
  <tbody>
  <% @schools.each do |school| %>
    <tr>
      <td><%= link_to school.name, admin_school_path(school) %></td>
      <td><%= y_n(school.archived?) %></td>
      <td><%= nice_dates(school.archived_date) %></td>
      <td><%= nice_dates(school.removal_date) %></td>
      <td>
        <% school.meters.each do |meter| %>
          <p><%= link_to meter.mpan_mprn, school_meters_path(meter.school) %></p>
        <% end %>
      </td>
    </tr>
  <% end %>
  </tbody>
</table>