Add notifications to setting update

This commit is contained in:
Martin Lensment 2014-09-22 20:24:25 +03:00
parent 18c7c2f374
commit eedbc211b5
2 changed files with 6 additions and 1 deletions

View file

@ -10,8 +10,10 @@ class Admin::SettingGroupsController < ApplicationController
def update
if @setting_group.update(setting_group_params)
flash[:notice] = I18n.t('shared.setting_updated')
redirect_to [:admin, @setting_group]
else
flash[:alert] = I18n.t('shared.failed_to_update_setting')
render 'show'
end
end

View file

@ -272,4 +272,7 @@ en:
failed_to_update_contact: 'Failed to update contact'
contact_updated: 'Contact updated'
search: 'Search'
reg_no: 'Reg no.'
reg_no: 'Reg. no'
setting_updated: 'Setting updated!'
failed_to_update_setting: 'Failed to update setting'