socksocket socksocket - 1 year ago 107
Ruby Question

Rails: path of file

I have inside

a directory called
and inside this dir I have a file called

I want to use
function to read the file.

what is the relative path to the file?

Answer Source
file = File.join(Rails.root, 'app', 'csv', 'names.csv')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download