I have a file data.txt
in the public
folder of my Rails project. I want to link to it from one of the pages in my project using link_to
. How can I do it?
If I do
<%= link_to "here", "data.txt" %>
it links to domain.com/data.txt
instead of domain.com/my_project/data.txt
.
It sounds like you want to access the file here:
<%= link_to "here", "/my_project/data.txt" %>