site_uploads_controller.rb 414 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. module Admin
  3. class SiteUploadsController < BaseController
  4. before_action :set_site_upload
  5. def destroy
  6. authorize :settings, :destroy?
  7. @site_upload.destroy!
  8. redirect_to admin_settings_path, notice: I18n.t('admin.site_uploads.destroyed_msg')
  9. end
  10. private
  11. def set_site_upload
  12. @site_upload = SiteUpload.find(params[:id])
  13. end
  14. end
  15. end