Can I use send_file to send a file on a drive other than the Rails.root drive? I've tried both options below. I need to use the second option but Rails doesn't like using a drive other than the volume on which it is on.
This works:
def action
send_file "C:\\rails_root\\public\\files\\file.ext"
end
This doesn't:
def action
send_file "D:\\files\\file.ext"
end
Is send_file restricted to just the Rails.root drive? Is it possible to serve static files from a directory on a network mapped drive? Oh, and this is (un)fortunately an all windows environment.
UPDATE: So I've been digging around in the Rails/Ruby code that send_file uses and I think the primary culprit here is File.file?(path). It returns true when on the drive which Rails lives but false for networked drives.
UPDATE 2: Really strange. In the console both locations inserted for File.file?(path) return true. In the application running in the browser it returns false. I'm stumped.