39 lines
1017 B
Plaintext
39 lines
1017 B
Plaintext
<main>
|
|
<p><%= notice %></p>
|
|
|
|
<h1>Vehicles</h1>
|
|
|
|
<nav aria-label="Vehicle filters">
|
|
<%= link_to "Active", vehicles_path %> |
|
|
<%= link_to "Inactive", vehicles_path(status: "inactive") %> |
|
|
<%= link_to "All", vehicles_path(status: "all") %>
|
|
</nav>
|
|
|
|
<p><%= link_to "New vehicle", new_vehicle_path %></p>
|
|
|
|
<% if @vehicles.any? %>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Vehicle</th>
|
|
<th>Licence plate</th>
|
|
<th>Odometer</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% @vehicles.each do |vehicle| %>
|
|
<tr>
|
|
<td><%= link_to "#{vehicle.year} #{vehicle.make} #{vehicle.model}", vehicle %></td>
|
|
<td><%= vehicle.licence_plate %></td>
|
|
<td><%= number_with_delimiter(vehicle.current_odometer) %></td>
|
|
<td><%= vehicle.active? ? "Active" : "Inactive" %></td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
<% else %>
|
|
<p>No vehicles found.</p>
|
|
<% end %>
|
|
</main>
|