MakersNetwork/agenda-saude

View on GitHub
app/views/admin/neighborhoods/index.html.erb

Summary

Maintainability
Test Coverage
<div class="row">
  <div class="col-10">
    <h1 class="h4">
      Bairros
    </h1>
  </div>

  <div class="col-2">
    <%= link_to "Criar bairro", new_admin_neighborhood_path, class: 'btn btn-primary btn-block' %>
  </div>
</div>

<table class="table table-bordered table-hover table-sm mt-3">
  <thead class="thead-dark">
  <tr>
    <th scope="col">#</th>
    <th scope="col">Bairro</th>
  </tr>
  </thead>
  <tbody>
  <% @neighborhoods.each do |neighborhood| -%>
    <tr data-cy="patient">
      <td>
        <%= link_to neighborhood.id, admin_neighborhood_path(neighborhood) %>
      </td>
      <th scope="row">
        <%= neighborhood.name %>
      </th>
    </tr>
  <% end -%>
  </tbody>
</table>

<div>
  <%= paginate @neighborhoods %>
</div>