I want to parse .csv file which is in public folder, I’ve tried /../‘s, #{RAILS_ROOT}/public but with no success (No such file or directory error). I dunno exactly how to use Rails.public_path (Rails.public_path/filename.csv doesn’t work) please help
I want to parse .csv file which is in public folder, I’ve tried /../
Share
You have access to the
Rails.rootpath, use it to get a pathYou’ll possibly have to call
to_son it depending on how you want to use the result (as aPathobject or as a string).