In rails when you create links in your view it’s best to use link_to or url_for tags when creating urls. However, both of these methods take as arguments the controller and/or action to generate a link for. If you’re trying to link to something in the public directory, like a static html file, then there is no controller or action. Instead of hardcoding the link, use compute_public_path:

<%=compute_public_path('file-name-without-extention','parent-dir','extension')%>

So if you’re trying to link to a file public/static_files/foo.html just do:

<%=compute_public_path('foo','static_files','html')%>