finish stockit i18n + controllers + model
This commit is contained in:
parent
0065c44b74
commit
a0a974b9ce
8 changed files with 79 additions and 34 deletions
|
|
@ -12,7 +12,7 @@ class StockitController < ApplicationController
|
|||
def create
|
||||
@stock_article = StockArticle.new(params[:stock_article])
|
||||
if @stock_article.save
|
||||
redirect_to stock_articles_path, :notice => "Lagerartikel wurde gespeichert."
|
||||
redirect_to stock_articles_path, :notice => I18n.t('stockit.stock_create.notice')
|
||||
else
|
||||
render :action => 'new'
|
||||
end
|
||||
|
|
@ -25,7 +25,7 @@ class StockitController < ApplicationController
|
|||
def update
|
||||
@stock_article = StockArticle.find(params[:id])
|
||||
if @stock_article.update_attributes(params[:stock_article])
|
||||
redirect_to stock_articles_path, :notice => "Lagerartikel wurde gespeichert."
|
||||
redirect_to stock_articles_path, :notice => I18n.t('stockit.stock_update.notice')
|
||||
else
|
||||
render :action => 'edit'
|
||||
end
|
||||
|
|
@ -35,7 +35,7 @@ class StockitController < ApplicationController
|
|||
StockArticle.find(params[:id]).destroy
|
||||
redirect_to stock_articles_path
|
||||
rescue => error
|
||||
flash[:error] = "Ein Fehler ist aufgetreten: " + error.message
|
||||
flash[:error] = I18n.t('errors.general_msg', :msg => error.message)
|
||||
redirect_to stock_articles_path
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue