Adds delete link to budget investment list in user activities

This commit is contained in:
kikito
2017-03-06 19:24:10 +01:00
parent 24920e73f6
commit 3dbdc8f455
6 changed files with 26 additions and 3 deletions

View File

@@ -55,7 +55,7 @@ module Budgets
end
def destroy
investment.destroy
@investment.destroy
redirect_to user_path(current_user, filter: 'budget_investments'), notice: t('flash.actions.destroy.budget_investment')
end

View File

@@ -4,6 +4,11 @@
<td>
<%= link_to budget_investment.title, budget_investment_path(budget_investment.budget, budget_investment) %>
</td>
<td>
<% if can? :destroy, budget_investment %>
<%= link_to t('shared.delete'), budget_investment_path(budget_investment.budget, budget_investment), method: :delete %>
<% end %>
</td>
</tr>
<% end %>
</table>