finish suppliers controller I18n
This commit is contained in:
parent
eb1e02015e
commit
d818ea5d53
3 changed files with 13 additions and 4 deletions
|
|
@ -27,7 +27,7 @@ class SuppliersController < ApplicationController
|
|||
def create
|
||||
@supplier = Supplier.new(params[:supplier])
|
||||
if @supplier.save
|
||||
flash[:notice] = "Lieferant wurde erstellt"
|
||||
flash[:notice] = I18n.t('suppliers.create.notice')
|
||||
redirect_to suppliers_path
|
||||
else
|
||||
render :action => 'new'
|
||||
|
|
@ -41,7 +41,7 @@ class SuppliersController < ApplicationController
|
|||
def update
|
||||
@supplier = Supplier.find(params[:id])
|
||||
if @supplier.update_attributes(params[:supplier])
|
||||
flash[:notice] = 'Lieferant wurde aktualisiert'
|
||||
flash[:notice] = I18n.t('suppliers.update.notice')
|
||||
redirect_to @supplier
|
||||
else
|
||||
render :action => 'edit'
|
||||
|
|
@ -51,10 +51,10 @@ class SuppliersController < ApplicationController
|
|||
def destroy
|
||||
@supplier = Supplier.find(params[:id])
|
||||
@supplier.destroy
|
||||
flash[:notice] = "Lieferant wurde gelöscht"
|
||||
flash[:notice] = I18n.t('suppliers.destroy.notice')
|
||||
redirect_to suppliers_path
|
||||
rescue => e
|
||||
flash[:error] = "Ein Fehler ist aufgetreten: " + e.message
|
||||
flash[:error] = I18n.t('errors.general_msg', :msg => e.message)
|
||||
redirect_to @supplier
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue