If you want to delete the file, but do not want to specify the full file name, you can use below.
It can also be used to delete many files or all files in a directory with a specific extension ...
file = Rails.root.join("tmp", "foo*")
or
file = Rails.root.join("tmp", ".pdf")
files = Dir.glob(file)
orion Sep 20 '16 at 3:08 2016-09-20 03:08
source share