app/views/agreements/versions/index.html.erb
<div class="card">
<header class="card-header d-flex align-items-center">
<h3 class="mr-auto">Agreement Versions - <%= @agreement.name %></h3>
<%= link_to '+ New Version', new_agreement_version_path(@agreement), class: "btn btn-primary" %>
</header>
<section>
<table class="table">
<thead>
<tr>
<th scope="col">Title</th>
<th scope="col">Active?</th>
<th scope="col">Version</th>
<th scope="col">Last Modified By</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
<% @versions.each do |version| %>
<tr>
<td><%= version.title %></td>
<td><% if version.active %>✓<% end %></td>
<td><%= version.version %></td>
<td><%= link_to version.last_modified_by %></td>
<td align="right">
<%= link_to 'Edit', edit_agreement_version_path(version.agreement, version), class: 'btn btn-primary btn-sm' %> |
<%= link_to 'Destroy', agreement_version_path(version.agreement, version), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger btn-sm' %>
</td>
</tr>
<% end %>
</tbody>
</table>
</section>
</div>