Topic: link_to a file in /public?

I've created a directory /public/resources which contains files I want users to be able to download (in particular, my site's terms of service and other legal minutia).  I want to be able to say:

link_to "Terms of Service", "/public/resources/Terms_Of_Service.doc"

So the user will get a link to the downloadable form of the document (i.e. a word document).  This all seems to work fine, but when I actually click on such a link, I get:

No route matches "/public/resources/Terms_Of_Service.docx" with {:method=>:get}

So what's the trick here?  How do I tell Rails essentially to ignore incoming requests to the /public/resources directory and just serve up those files directly?

Re: link_to a file in /public?

/public is the virtual root directory of your application, from a browsers point of view, so you don't have to add it to the links url.

Every made a new rails app and went to localhost:3000 and saw the index.html file? Well, it's placed in /public, but you didn't got to localhost:3000/public to see it.

Long story cur short:

link_to "Terms of Service", "/resources/Terms_Of_Service.doc"

just make sure you don't have a resourcescontroller, that will conflict.

Re: link_to a file in /public?

Sigh.  As with All Things Rails, it seems, understanding it is subtle and tricky, but once you understand it, fixing becomes truly trivial.