unepwcmc/SAPI

View on GitHub
app/views/admin/taxon_relationships/_list.html.erb

Summary

Maintainability
Test Coverage
<thead>
  <th>Taxon Concept</th>
  <th width="20%">Relationship type</th>
  <th>Related taxon concept</th>
  <th width="10%">Actions</th>
</thead>
<tbody>
  <% collection.each do |taxon_relationship| -%>
    <tr>
      <td>
        <%= link_to taxon_relationship.taxon_concept.full_name, admin_taxon_concept_taxon_relationships_path(taxon_relationship.taxon_concept) %>
        (<%= link_to taxon_relationship.taxon_concept.taxonomy.name, admin_taxonomy_path(taxon_relationship.taxon_concept.taxonomy) %>)
      </td>
      <td>
        <%= taxon_relationship.taxon_relationship_type.name %>
      </td>
      <td>
        <%= link_to taxon_relationship.other_taxon_concept.full_name, admin_taxon_concept_taxon_relationships_path(taxon_relationship.other_taxon_concept) %>
        (<%= link_to taxon_relationship.other_taxon_concept.taxonomy.name, admin_taxonomy_path(taxon_relationship.other_taxon_concept.taxonomy) %>)
      </td>
      <td>
        <% if can? :destroy, taxon_relationship %>
          <%= link_to delete_icon, resource_url(taxon_relationship, :type => params[:type]),
            data: { confirm: "Warning: you are about to delete data. Are you sure?" },
            :method => :delete %>
        <% end %>
      </td>
    </tr>
  <% end -%>
</tbody>