我创建了一个带有列 ID、任务、描述的 Excel 工作表
我找到了这个并把它放在我的seeds.rb中:
require 'spreadsheet'
Spreadsheet.open('/db/data/uebung.xls') do |uebung|
book.worksheet('Sheet1').each do |row|
break if row[0].nil?
puts row.join(',')
end
end
我收到这条消息:
[DEPRECATED] By requiring 'parseexcel', 'parseexcel/parseexcel' and/or
'parseexcel/parser' you are loading a Compatibility layer which
provides a drop-in replacement for the ParseExcel library. This
code makes the reading of Spreadsheet documents less efficient and
will be removed in Spreadsheet version 1.0.0
你觉得怎么样。是不是很容易导入excel数据?