Rails: path of file

前端 未结 4 800
庸人自扰
庸人自扰 2021-02-03 19:20

I have inside app a directory called csv and inside this dir I have a file called names.csv I want to use File.read(path:string)

4条回答
  •  春和景丽
    2021-02-03 19:49

    Thanks for above answers, It also worked this way for me:

    "#{Rails.root}/public/spreadsheets/file_name.xlsx"
    

提交回复
热议问题