/
_incomes.html.erb
32 lines (29 loc) · 939 Bytes
/
_incomes.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<div class="bordered-form" >
<h2>Incomes</h2>
<div> - this is going to be an incomes show page which will list all of the incomes and allow the user to add new income values as the week goes. In the long run this will help keep track of projections.</div>
<!--<%= link_to 'Add Income', new_mybudget_income_path(@mybudget, @income) %>-->
<%= link_to new_mybudget_income_path(@mybudget, @income),
remote: true, id: "new-item-link", class: "btn btn-sm btn-default round" do %> New
<%end%>
<table class="table" >
<thead>
<tr>
<th>Incomes</th>
</tr>
</thead>
<tbody>
<% @mybudget.incomes.each do |income| %>
<tr>
<div id="incomes"></div>
<td class="table-items"><%= income.income %></td>
<td class="amount">$<%= income.amount %></td>
<td></td>
</tr>
<% end %>
</tbody>
</table>
<br>
<div>TOTAL INCOME</div>
<div class="total-output"><%= Income.sum(:amount) %>
</div>
</div>