--- attachments_controller.rb 2020-08-25 09:00:50.000000000 +0200 +++ inline_attachment_images.rb 2020-08-25 08:46:12.000000000 +0200 @@ -1,7 +1,16 @@ - def disposition(attachment) +module InlineAttachmentImages + private def disposition(attachment) if attachment.is_pdf? 'inline' + elsif attachment.is_image? + 'inline' else 'attachment' end end +end + +require_dependency 'attachments_controller' +class ::AttachmentsController + prepend InlineAttachmentImages +end