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> <h1>Expenses</h1>
<div id="expenses"> <div id="expenses">
<table>
<tr>
<th>Name</th>
<th>Amount</th>
<th colspan="3"></th>
</tr>
<% @expenses.each do |expense| %> <% @expenses.each do |expense| %>
<%= render expense %> <tr>
<p> <td><%= expense.name %></td>
<%= link_to "Show this expense", expense %> <td><%= expense.amount %></td>
</p> <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 %> <% end %>
</div> </div>