There is a path on a local machine (UNIX) like:
/system/site/photos/000/342/small/12104_%281%29.jpg?1468158362 I try to check if the file exists, but all the options that I found in Google or the documentation always give out false .
small_img = photo.url(:small) unless File.file?(:small) small_img = photo.url(:original) end render partial: 'common/image_preview', locals: { original: photo.url, thumb: photo.url(:thumb), medium: small_img }
cdon the file system, what is the full path to this file? Is he even there? - D-sideFile.file?(:small). In general, it is very similar toPaperclip. If you have guessed, then you do not need to reinvent the wheel. Need to see the documentation. Everything is already invented. And yes, it is doubtful to use theurlas a path to the file. At a minimum, there are methods that allow you to get exactly the path in the file system. - anoam