I have tried to use Nokogiri just to grab all the data s i could go around saving it into an .csv file. However, I kept getting 503 errors so i had to work around it.
I have an excel file with rows :name :address :phone :image and i want to import this data into my preexisting database.
My preexisting table in ruby is
I saved my .csv file in my db folder and added import.rake to lib/tasks
when i run rake import i get
it gives this error for each of the rows I tried to import.
I am also worried that I'm doing this wrong and it will mess up my db so any advice would be appreciated.
The issue is not in the CSV file. It is in your ruby code. You must add double braces around your `create` method like this:
Also, if you are worrying about the data in your database, then you should not be running this code in your production environment. As a test run, you can run this code in sandboxed rails console (`rails c -s`).
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
a bit of art, as a gift, that will fit in a stocking