我只想让表单读取 .csv 文件的内容而不将它们存储在任何地方并执行此操作
csv_text = File.read('thefiletheychoose') # If this line isnt possible can we store the contents of the csv temp somewhere?
csv = CSV.parse(csv_text, :headers => true)
csv.each do |row|
row = row.to_hash.with_indifferent_access
Company.create!(row.to_hash.symbolize_keys)
end
我不知道 .html 会是什么样子