obdev/app/views/participants/index.html.erb

43 lines
1.5 KiB
Plaintext
Raw Normal View History

<div class="container mt-5">
<h1 class="mb-4 text-center">Participants</h1>
<table class="table table-striped table-hover">
<thead class="table-dark">
<tr>
<th>Name</th>
<th>Address</th>
<th>Phone</th>
<th>Email</th>
<th>Program</th>
<th>MCI</th>
<th>DOB</th>
<th>SSN</th>
<th>Gender</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @participants.each do |participant| %>
<tr>
<td><%= participant.name %></td>
<td><%= participant.address %></td>
<td><%= participant.phone %></td>
<td><%= participant.email %></td>
<td><%= participant.programs.map(&:name).join(", ") %></td>
<td><%= participant.mci %></td>
<td><%= participant.dob.strftime('%B, %d, %Y') if participant.dob %></td>
<td><%= participant.ssn %></td>
<td><%= participant.gender %></td>
<td><%= link_to 'Show', participant, class: 'btn btn-sm btn-info' %></td>
<td><%= link_to 'Edit', edit_participant_path(participant), class: 'btn btn-sm btn-primary' %></td>
<td><%= link_to 'Destroy', participant, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger' %></td>
</tr>
<% end %>
</tbody>
</table>
<div class="text-center mt-3">
<%= link_to 'New Participant', new_participant_path, class: 'btn btn-success' %>
</div>
</div>