From 564291559f98a6541ba596050441adcf34db93c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 14 Dec 2018 13:36:15 +0100 Subject: [PATCH] display images inline (#29056) --- lib/attachments_controller_patch.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/attachments_controller_patch.rb b/lib/attachments_controller_patch.rb index 9e5e8ae..efd3a66 100644 --- a/lib/attachments_controller_patch.rb +++ b/lib/attachments_controller_patch.rb @@ -34,6 +34,14 @@ module AttachmentsControllerPatch end end + def disposition(attachment) + if attachment.is_pdf? || attachment.is_image? + 'inline' + else + 'attachment' + end + end + end end end