2024-07-11 19:55:48 +02:00
|
|
|
<p style="color: green"><%= notice %></p>
|
|
|
|
|
|
|
|
<h1>Expenses</h1>
|
|
|
|
|
|
|
|
<div id="expenses">
|
2024-07-11 19:57:51 +02:00
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Amount</th>
|
2024-07-11 20:01:53 +02:00
|
|
|
<th colspan="2"></th>
|
2024-07-11 19:57:51 +02:00
|
|
|
</tr>
|
2024-07-11 19:55:48 +02:00
|
|
|
<% @expenses.each do |expense| %>
|
2024-07-11 19:57:51 +02:00
|
|
|
<tr>
|
|
|
|
<td><%= expense.name %></td>
|
|
|
|
<td><%= expense.amount %></td>
|
|
|
|
<td><%= link_to "Show", expense %></td>
|
|
|
|
<td><%= link_to "Edit", edit_expense_path(expense) %></td>
|
2024-07-11 20:03:49 +02:00
|
|
|
</tr>
|
2024-07-11 19:55:48 +02:00
|
|
|
<% end %>
|
2024-07-11 20:03:49 +02:00
|
|
|
<tr>
|
|
|
|
<td>Total</td>
|
|
|
|
<td><%= @expenses.sum(&:amount) %></td>
|
|
|
|
<td colspan="2"></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2024-07-11 19:55:48 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<%= link_to "New expense", new_expense_path %>
|