Skip to content

Instantly share code, notes, and snippets.

@basuneko
Created August 22, 2011 15:17
Show Gist options
  • Save basuneko/1162627 to your computer and use it in GitHub Desktop.
Save basuneko/1162627 to your computer and use it in GitHub Desktop.
spreadsheet bug
price = params[:price]
File.open(Rails.root.join('tmp', 'price.xls'), 'wb') do |file|
file.write(price.read)
end
book = Spreadsheet.open "#{Rails.root}/tmp/price.xls"
sheet = book.worksheet 0
sheet.each do |row| #this rows throws the "Called id for nil, which would mistakenly be 4..." error
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment