Display total
This commit is contained in:
parent
4a31153dc8
commit
8bac32bb77
@ -15,7 +15,14 @@
|
|||||||
<td><%= expense.amount %></td>
|
<td><%= expense.amount %></td>
|
||||||
<td><%= link_to "Show", expense %></td>
|
<td><%= link_to "Show", expense %></td>
|
||||||
<td><%= link_to "Edit", edit_expense_path(expense) %></td>
|
<td><%= link_to "Edit", edit_expense_path(expense) %></td>
|
||||||
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<tr>
|
||||||
|
<td>Total</td>
|
||||||
|
<td><%= @expenses.sum(&:amount) %></td>
|
||||||
|
<td colspan="2"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= link_to "New expense", new_expense_path %>
|
<%= link_to "New expense", new_expense_path %>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user