libertarian-party/partynest

View on GitHub
app/views/federal_subjects/_table.html.erb

Summary

Maintainability
Test Coverage
<table class="table">
  <thead>
    <tr>
      <th scope="col">
        <%= FederalSubject.human_attribute_name :number %>
      </th>
      <th scope="col">
        <%= FederalSubject.human_attribute_name :display_name %>
      </th>
      <th scope="col">
        <%= FederalSubject.human_attribute_name :centre %>
      </th>
      <th scope="col">
        <%= FederalSubject.human_attribute_name :timezone %>
      </th>
      <th scope="col"></th>
    </tr>
  </thead>

  <tbody>
    <% federal_subjects.each do |federal_subject| %>
      <tr>
        <td><%= federal_subject.number %></td>
        <td><%= truncate federal_subject.display_name, length: 25 %></td>
        <td><%= truncate federal_subject.centre, length: 15 %></td>
        <td><%= federal_subject.timezone %></td>
        <td>
          <% if policy(federal_subject).show? %>
            <%= open_action federal_subject %>
          <% end %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>