Fix i18n translations warnings.

This commit is contained in:
Senén Rodero Rodríguez
2017-07-24 11:36:45 +02:00
parent 63621aa526
commit 17ad148cd7
4 changed files with 8 additions and 4 deletions

View File

@@ -19,8 +19,11 @@ class DocumentsController < ApplicationController
end
def destroy
@document.destroy
flash[:notice] = t "documents.actions.destroy.notice"
if @document.destroy
flash[:notice] = t "documents.actions.destroy.notice"
else
flash[:alert] = t "documents.actions.destroy.alert"
end
redirect_to params[:from]
end