Allow to remove budget investment image from edit image page to authors and administrators.

This commit is contained in:
Senén Rodero Rodríguez
2017-06-23 14:23:58 +02:00
parent 943ef06ec8
commit 4469aa9b32
11 changed files with 85 additions and 8 deletions

View File

@@ -92,6 +92,14 @@ module Budgets
end
end
def remove_image
@investment.image = nil
@investment.image_title = nil
@investment.save
redirect_to budget_investment_path(@investment.budget, @investment),
notice: t("flash.actions.remove_image.budget_investment")
end
private
def resource_model