0

I followed this example, File uploads with CarrierWave to upload an excel file (Classlist) in my application. The file contains the student names, surnames and gender.

When uploading, User will give a name and subject for this "Class". Which will then be stored in MyClasses table. I want to know if I can read the contents of the file and save contents (names,surnames,gender) in the Student table?

The excel file uploaded looks like this...

Classlist

Lesego M
  • 459
  • 1
  • 9
  • 15
  • 1
    I had a similar task and I used the [roo](https://github.com/roo-rb/roo) gem for that problem. – Vucko Mar 10 '17 at 09:28
  • Carrierwave is for uploading the file not for reading the content of file .If you want to achieve this functionality refer these links http://stackoverflow.com/questions/3309511/how-do-i-read-the-content-of-an-excel-spreadsheet-using-ruby and this http://railscasts.com/episodes/396-importing-csv-and-excel – Aniket Tiwari Mar 10 '17 at 10:20
  • Thank you for the clarification and suggestions. I'll look into these. – Lesego M Mar 10 '17 at 11:25

0 Answers0