diff options
author | ThibG <thib@sitedethib.com> | 2020-03-08 22:09:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 22:09:53 +0100 |
commit | 840b17e3444f9a68d3639f1ffeb326e8cb1e03b1 (patch) | |
tree | 8254538ed33f4c4b974b5379f3b5a0b489ba095a /app/controllers/admin | |
parent | 13ef4d5fb0dbb66074f42df7989ae40509a4724f (diff) | |
parent | 9c2922958783f7e499cdda5bb874d6096e47eb0a (diff) |
Merge pull request #1297 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/site_uploads_controller.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/controllers/admin/site_uploads_controller.rb b/app/controllers/admin/site_uploads_controller.rb new file mode 100644 index 000000000..cacecedb0 --- /dev/null +++ b/app/controllers/admin/site_uploads_controller.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Admin + class SiteUploadsController < BaseController + before_action :set_site_upload + + def destroy + authorize :settings, :destroy? + + @site_upload.destroy! + + redirect_to edit_admin_settings_path, notice: I18n.t('admin.site_uploads.destroyed_msg') + end + + private + + def set_site_upload + @site_upload = SiteUpload.find(params[:id]) + end + end +end |