I am trying to take the content of a CSV file, then use these contents to generate another file.
The approach I've taken is to import my data into a model (http://railscasts.com/episodes/396-importing-csv-and-excel).
Now I want to take the data from the database and create a text file.
I've created a Ruby file using:
target = "target.rb"
content = "test"
File.open(target, "w+") do |f|
f.write(content)
end
I can't work out how to fill 'content' with the data from my data model.
Any suggestions?