Skip to content

Commit

Permalink
specify download filename
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Jan 18, 2021
1 parent 12137e1 commit aa91ed7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ spec/dummy/private/
spec/dummy/solr/
spec/dummy/tmp/
spec/cassette_library/
node_modules
2 changes: 1 addition & 1 deletion app/controllers/event_import_files_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def show
format.html # show.html.erb
format.json { render json: @event_import_file }
format.download {
send_data @event_import_file.event_import.download if @event_import_file.event_import.attached?
send_data @event_import_file.attachment.download, filename: @event_import_file.attachment.filename.to_s, type: @event_import_file.attachment.content_type
}
end
end
Expand Down

0 comments on commit aa91ed7

Please sign in to comment.