I have an XML file containing data and I can easily parse it to insert the data into my rails database. The only problem is – in which directory should the file go into (“public” seems wrong, since the initial data in the database should not be public), and how do I refer to that file in the seeds.rb file (i.e. what prefix will guarantee that that file will be found).
This is a somewhat silly question but I haven’t touched rails for a time now and they keep changing the directory structure…
I’d simply put the file in a folder like
/db/data_sourcebecauseseeds.rblives in/dbso it keeps overall logic.You can reference any file using: