I've got a bunch of files in public/downloads/ directory now how do I get url for them?
P.S. doing just /downloads/xyz.tar.bz2 won't do, because app can be deployed to sub URI.
UPD I've found a dead simple solution:
def public_url(file) root_url + file end
preguntado el 08 de noviembre de 11 a las 15:11
I think normalocity was almost right here, but it should rather be
<%= link_to "The file", root_path+"/downloads/test.txt" %>
That should match whatever sub-uri your app resides under, and then append the path to the static file to it.