how to read spreadsheet in ruby on rails

Articles is about reading Spreadsheet content row by row and inserting it in array

sample_array = []
spread = Spreadsheet.open("#{FILEPATH}/source.xls") #FILEPATH => complete file path, example1.xls => filename
sheet1 = spread.worksheet 0
sheet1.each 1 do |row|
  sample_array << row
end