better filenames for export

This commit is contained in:
Arpit Jalan
2015-01-02 12:29:05 +05:30
parent e46abdd4a2
commit bfe95966b4
5 changed files with 16 additions and 15 deletions

View File

@ -15,7 +15,7 @@ class ExportCsvController < ApplicationController
def show
params.require(:id)
filename = params.fetch(:id)
export_id = filename.split('_')[1].split('.')[0]
export_id = filename.split('-')[2].split('.')[0]
export_initiated_by_user_id = 0
export_initiated_by_user_id = UserExport.where(id: export_id)[0].user_id unless UserExport.where(id: export_id).empty?
export_csv_path = UserExport.get_download_path(filename)