Use paperclip destroy function instead of setting object to nil.

This commit is contained in:
Senén Rodero Rodríguez
2017-06-26 15:47:48 +02:00
parent 8ce237805c
commit 7b63f01a86

View File

@@ -93,7 +93,7 @@ module Budgets
end
def remove_image
@investment.image = nil
@investment.image.destroy
@investment.image_title = nil
@investment.save
redirect_to budget_investment_path(@investment.budget, @investment),