diff options
author | gebele <gebele@in-silico.ch> | 2018-12-03 15:18:06 +0000 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2018-12-03 15:18:06 +0000 |
commit | 993102a8b2f131526e4578f514b4392c77f2b47d (patch) | |
tree | ee96a384f3b9418209cca0cea67418d1cf4aede1 /application.rb | |
parent | d025b486306fea19d5454166701ea29b2953d014 (diff) |
fixed csv download;added analytics and batch files
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/application.rb b/application.rb index dd62fb6..aaa18ae 100644 --- a/application.rb +++ b/application.rb @@ -123,7 +123,10 @@ get '/predict/dataset/:name' do response['Content-Type'] = "text/csv" dataset = Dataset.find_by(:name=>params[:name]) csv = dataset.to_csv - csv + t = Tempfile.new + t << csv + name = params[:name] + ".csv" + send_file t.path, :filename => name, :type => "text/csv", :disposition => "attachment" end get '/predict/:tmppath/:filename/?' do |