Add ability to delete records #2806

This commit is contained in:
Martin Lensment 2015-08-03 12:23:48 +03:00
parent 44b2d383b1
commit 72b322ae1f
4 changed files with 21 additions and 0 deletions

View file

@ -35,6 +35,16 @@ class Admin::ZonefileSettingsController < AdminController
end
end
def destroy
if @zonefile_setting.destroy
flash[:notice] = I18n.t('record_deleted')
redirect_to admin_zonefile_settings_path
else
flash.now[:alert] = I18n.t('failed_to_delete_record')
render 'edit'
end
end
private
def set_zonefile_setting