diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-05-02 18:25:26 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-05-02 18:25:26 +0300 |
commit | c5dee301f8bb6496c09c2aef54f9665b350c535f (patch) | |
tree | ae6354684944ff91413a5c2cceb9126014aff893 /app/controllers/concerns | |
parent | d32ecb23eb10065b1cc5eea95f4271ef402f0059 (diff) | |
parent | 0ca6ff67e438a8218ac53edd6280041d2f4b7a9c (diff) |
Merge branch 'dm-snippet-download-button' into 'master'
Add download button to project snippets
See merge request !11004
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r-- | app/controllers/concerns/snippets_actions.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/concerns/snippets_actions.rb b/app/controllers/concerns/snippets_actions.rb index ca6dffe1cc5..ffea712a833 100644 --- a/app/controllers/concerns/snippets_actions.rb +++ b/app/controllers/concerns/snippets_actions.rb @@ -5,10 +5,12 @@ module SnippetsActions end def raw + disposition = params[:inline] == 'false' ? 'attachment' : 'inline' + send_data( convert_line_endings(@snippet.content), type: 'text/plain; charset=utf-8', - disposition: 'inline', + disposition: disposition, filename: @snippet.sanitized_file_name ) end |