I am using Redmine for internal issue tracking.
I wanted PDFs to be displayed in the browser. This required a quick-and-dirty hack, which I found here: https://www.redmine.org/boards/3/topics/26320
The essence of the hack:
Add to app/models/attachment.rb
, somewhere next to def thumbnailable
:
def pdf?
!!(self.filename =~ /\.(pdf)$/i)
end
Then modify app/controllers/attachments_controller.rb
. Change the line:
:disposition => (@attachment.image? ? 'inline' : 'attachment')
to
:disposition => (@attachment.image? || @attachment.pdf? ? 'inline' : 'attachment')