Extract registrar controller translations in admin area

#279
This commit is contained in:
Artur Beljajev 2017-02-20 13:00:45 +02:00
parent 6f907e11b5
commit b4b715f405
7 changed files with 61 additions and 11 deletions

View file

@ -23,10 +23,10 @@ class Admin::RegistrarsController < AdminController
@registrar.accounts.create!(account_type: Account::CASH, currency: 'EUR')
end
flash[:notice] = I18n.t('registrar_added')
flash[:notice] = t('.created')
redirect_to [:admin, @registrar]
rescue ActiveRecord::RecordInvalid
flash.now[:alert] = I18n.t('failed_to_add_registrar')
flash.now[:alert] = t('.not_created')
render 'new'
end
end
@ -35,10 +35,10 @@ class Admin::RegistrarsController < AdminController
def update
if @registrar.update(registrar_params)
flash[:notice] = I18n.t('registrar_updated')
flash[:notice] = t('.updated')
redirect_to [:admin, @registrar]
else
flash.now[:alert] = I18n.t('failed_to_update_registrar')
flash.now[:alert] = t('.not_updated')
render 'edit'
end
end