users can now delete their own spending proposals

via the 'my activity' page
This commit is contained in:
Juanjo Bazán
2016-03-14 12:53:00 +01:00
parent 142c981cdf
commit c09e6f95d7
10 changed files with 64 additions and 7 deletions

View File

@@ -28,6 +28,12 @@ class SpendingProposalsController < ApplicationController
end
end
def destroy
spending_proposal = current_user.spending_proposals.find(params[:id])
spending_proposal.destroy
redirect_to user_path(current_user, filter: 'spending_proposals'), notice: t('flash.actions.destroy.spending_proposal')
end
private
def spending_proposal_params