Skip to content
Snippets Groups Projects
Commit f4ce0ddd authored by Douwe Maan's avatar Douwe Maan
Browse files

Show image attachments in browser instead of downloading them.

Resolves #1702.
parent 56a456b4
No related branches found
No related tags found
No related merge requests found
Loading
@@ -5,7 +5,8 @@ class FilesController < ApplicationController
Loading
@@ -5,7 +5,8 @@ class FilesController < ApplicationController
   
if uploader.file_storage? if uploader.file_storage?
if can?(current_user, :read_project, note.project) if can?(current_user, :read_project, note.project)
send_file uploader.file.path, disposition: 'attachment' disposition = uploader.image? ? 'inline' : 'attachment'
send_file uploader.file.path, disposition: disposition
else else
not_found! not_found!
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment