#Docker
##Files and Folders.
|
|\_ app
|...
|\_ docker
| |
#Docker
##Files and Folders.
|
|\_ app
|...
|\_ docker
| |
| 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 |
| def create | |
| require 'spreadsheet' | |
| #for debugging purposes the file path is hardcoded | |
| book = Spreadsheet.open "#{Rails.root}/public/price.xls" | |
| sheet = book.worksheet 0 | |
| sheet.each do |row| | |
| font = row.format(0).font # read font data of the first cell in the row | |