Display table of expenses

This commit is contained in:
Manuel Bustillo 2024-07-11 19:57:51 +02:00
parent 98eb2e0473
commit c4e25d22a8

View File

@ -3,11 +3,19 @@
<h1>Expenses</h1>
<div id="expenses">
<table>
<tr>
<th>Name</th>
<th>Amount</th>
<th colspan="3"></th>
</tr>
<% @expenses.each do |expense| %>
<%= render expense %>
<p>
<%= link_to "Show this expense", expense %>
</p>
<tr>
<td><%= expense.name %></td>
<td><%= expense.amount %></td>
<td><%= link_to "Show", expense %></td>
<td><%= link_to "Edit", edit_expense_path(expense) %></td>
<td><%= link_to "Destroy", expense, method: :delete, data: { confirm: "Are you sure?" } %></td>
<% end %>
</div>