From 993102a8b2f131526e4578f514b4392c77f2b47d Mon Sep 17 00:00:00 2001 From: gebele Date: Mon, 3 Dec 2018 15:18:06 +0000 Subject: fixed csv download;added analytics and batch files --- application.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'application.rb') 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 -- cgit v1.2.3