From 9a3ab1458e340e05483feccf8a998e49ecf03051 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Wed, 11 Oct 2017 01:37:40 +0200 Subject: [PATCH] Use short syntax for the translations in DocumentsController --- .../documents/app/controllers/documents_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/documents/app/controllers/documents_controller.rb b/plugins/documents/app/controllers/documents_controller.rb index f1a57df6..e249d0e1 100644 --- a/plugins/documents/app/controllers/documents_controller.rb +++ b/plugins/documents/app/controllers/documents_controller.rb @@ -35,21 +35,21 @@ class DocumentsController < ApplicationController end @document.created_by = current_user @document.save! - redirect_to documents_path, notice: I18n.t('documents.create.notice') + redirect_to documents_path, notice: t('.notice') rescue => error - redirect_to documents_path, alert: t('documents.create.error', error: error.message) + redirect_to documents_path, alert: t('.error', error: error.message) end def destroy @document = Document.find(params[:id]) if @document.created_by == current_user or current_user.role_admin? @document.destroy - redirect_to documents_path, notice: t('documents.destroy.notice') + redirect_to documents_path, notice: t('.notice') else - redirect_to documents_path, alert: t('documents.destroy.no_right') + redirect_to documents_path, alert: t('.no_right') end rescue => error - redirect_to documents_path, alert: t('documents.destroy.error', error: error.message) + redirect_to documents_path, alert: t('.error', error: error.message) end def show