From 99e08ff204b029a497650dfcd4a5c6d5d446ef4e Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Sun, 31 Aug 2014 18:03:28 +0300 Subject: [PATCH] Allow only jp(e)g and png uploads --- app/uploaders/picture_uploader.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/uploaders/picture_uploader.rb b/app/uploaders/picture_uploader.rb index 217f662..0b0d0f2 100644 --- a/app/uploaders/picture_uploader.rb +++ b/app/uploaders/picture_uploader.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - class PictureUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: @@ -38,9 +36,9 @@ class PictureUploader < CarrierWave::Uploader::Base # Add a white list of extensions which are allowed to be uploaded. # For images you might use something like this: - # def extension_white_list - # %w(jpg jpeg gif png) - # end + def extension_white_list + %w(jpg jpeg png) + end # Override the filename of the uploaded files: # Avoid using model.id or version_name here, see uploader/store.rb for details. -- 2.40.1