From 3cb5e2965d24c2ba5270f5b7a0dab5624a3516da Mon Sep 17 00:00:00 2001 From: Torsten Date: Sun, 18 Jun 2023 16:22:08 +0300 Subject: [PATCH] only picture uploads --- app/uploaders/picture_uploader.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/uploaders/picture_uploader.rb b/app/uploaders/picture_uploader.rb index 42856bd..670fd90 100644 --- a/app/uploaders/picture_uploader.rb +++ b/app/uploaders/picture_uploader.rb @@ -31,12 +31,10 @@ class PictureUploader < CarrierWave::Uploader::Base # process resize_to_fit: [50, 50] # end - # Add an allowlist of extensions which are allowed to be uploaded. - # For images you might use something like this: - # def extension_allowlist - # %w(jpg jpeg gif png) - # end - + def content_type_allowlist + /image\// + end + # Override the filename of the uploaded files: # Avoid using model.id or version_name here, see uploader/store.rb for details. # def filename