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

45 lines
1.4 KiB
Plaintext
Raw Normal View History

<div class="container mt-5">
<h1 class="mb-4 text-center">Employers</h1>
<div class="text-center mt-3">
<%= link_to 'New Employer', new_employer_path, class: 'btn btn-dark mb-3' %>
</div>
<table class="table table-striped table-hover">
<thead class="table-light">
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Address</th>
<th>Phone</th>
<th>Email</th>
<th>DOB</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% @employers.each do |employer| %>
<tr>
<td><%= employer.first_name %> <%= employer.last_name %></td>
<td><%= [employer.address_line_1, employer.address_line_2, employer.city, employer.state, employer.zip].compact.join(', ') %></td>
<td><%= employer.phone %></td>
<td><%= employer.email %></td>
<td><%= employer.dob.strftime('%B %d, %Y') if employer.dob %></td>
<td>
<%= link_to employer, class: 'btn btn-sm btn-secondary' do %>
<i class="bi bi-eye"></i> <!-- Eyeball icon for 'Show' -->
<% end %>
<%= link_to edit_employer_path(employer), class: 'btn btn-sm btn-info' do %>
<i class="bi bi-pencil-fill" style="color: white;"></i> <!-- Pencil icon for 'Edit' -->
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>