Permalink
Browse files

just commiting to prevent shit to happen

  • Loading branch information...
gleisernicolas committed Nov 10, 2017
1 parent 2939ef2 commit 85e108e132bab0eeb2c7b6e6ec0147c5c933e1e6
@@ -9,6 +9,7 @@ def new
def create
@expense = Expense.new(expense_params)
if @expense.save
@expense.user_expenses.create(user: current_user, role: 0)
flash[:notice] = 'Rateio cadastrado com sucesso!'
redirect_to expense_url @expense
else
@@ -43,7 +44,13 @@ def edit
end
def update
@expense = Expense.new(expense_params)
if @expense.save
flash[:notice] = 'Rateio atualizado com sucesso!'
redirect_to expense_url @expense
else
render :new
end
end
private
@@ -19,9 +19,11 @@
<dd><%= expense.participants_amount %></dd>
<% if expense.owner? current_user%>
<button class="btn-danger">Apagar rateio</button>
<%= link_to 'Editar', edit_expense_path, class: 'btn btn-info' %>
<% end %>
<%= link_to 'Editar', edit_expense_path, class: 'btn btn-info' %>
<dt>Valor por participante</dt>
<dd><%= number_to_currency(expense.pricer_per_participant) %></dd>
<h2>Participantes</h2>
@@ -4,5 +4,4 @@
<%= render 'form' %>
</div>
<div class="col-md-2"></div>
</div>
View
@@ -1,5 +1,5 @@
{
"result": {
"covered_percent": 79.1
"covered_percent": 72.97
}
}
View
@@ -32,7 +32,7 @@
1,
null,
1,
3,
4,
null,
null,
1,
@@ -55,6 +55,7 @@
3,
2,
2,
2,
null,
1,
null,
@@ -83,8 +84,16 @@
null,
null,
1,
0,
null,
null,
1,
0,
0,
0,
0,
null,
0,
null,
null,
1,
@@ -137,6 +146,6 @@
0
]
},
"timestamp": 1510272102
"timestamp": 1510349156
}
}
Oops, something went wrong.

0 comments on commit 85e108e

Please sign in to comment.