Create csv from csv content
This commit is contained in:
@@ -43,6 +43,18 @@ class ItemsController < ApplicationController
|
||||
["Import items", "import_items"],
|
||||
["Update prices", "update_prices"] ]
|
||||
|
||||
@csv_content = params[:csv_content]
|
||||
|
||||
@error_message = ""
|
||||
@error_message = "Format of CSV is wrong (CSV content is empty)" if params[:csv_content] == ""
|
||||
|
||||
csv_file = ItemsHelper::create_csv(CSV.parse(params[:csv_content]))
|
||||
begin
|
||||
|
||||
ensure
|
||||
csv_file.unlink
|
||||
end
|
||||
|
||||
render :template => "items/export_import"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user