开发者

How do I use File.new to find a file from Rails?

开发者 https://www.devze.com 2022-12-31 14:37 出处:网络
I am trying to read a file that has been saved o开发者_开发技巧n the /system folder using Paperclip, for example.But when I use that .url method from Paperclip to read that file using File.new, I get

I am trying to read a file that has been saved o开发者_开发技巧n the /system folder using Paperclip, for example. But when I use that .url method from Paperclip to read that file using File.new, I get that the file isn't found. The directory is correct, but I still can't access it.

What is the right way to find a file for File.new for example? I tried to point to other files, as well, and to no avail.


I think you want the path method. That returns the filesystem path.

0

精彩评论

暂无评论...
验证码 换一张
取 消