From bf8fb3cceb8f20bad9f4959c1bcd627fe8d7743f Mon Sep 17 00:00:00 2001 From: Uilton Dutra Date: Tue, 19 Jan 2016 17:21:11 -0200 Subject: [PATCH] Add SVG file extension to the image detection method --- lib/rails_admin/config/fields/types/file_upload.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rails_admin/config/fields/types/file_upload.rb b/lib/rails_admin/config/fields/types/file_upload.rb index 8a8c58f279..5f9f5b0b3f 100644 --- a/lib/rails_admin/config/fields/types/file_upload.rb +++ b/lib/rails_admin/config/fields/types/file_upload.rb @@ -42,7 +42,7 @@ class FileUpload < RailsAdmin::Config::Fields::Base end register_instance_option :image? do - (url = resource_url.to_s) && url.split('.').last =~ /jpg|jpeg|png|gif/i + (url = resource_url.to_s) && url.split('.').last =~ /jpg|jpeg|png|gif|svg/i end register_instance_option :allowed_methods do