> For the complete documentation index, see [llms.txt](https://yutakatay.gitbook.io/katapedia/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yutakatay.gitbook.io/katapedia/doc/htmlpdfnirinkusurudaunrdoshinai.md).

# Htmlpdfに直リンクする（ダウンロードしない）方法

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')
