0

I have a little problem: I have a file stored in public/uploads//paper/foo/bar. This file is stored here by carrierwave (gem for file upload). Now, I want to put a link in my project to this file, but if I do like this: <a href="<%=a.document%>"> <%=a.name%></a> I get a routing error like this: No route matches [GET] "/uploads/paper/foo/bar/file.pdf".

How can I skip this default behavior of links in rails?

2
  • Are you sure that file is present at uploads/paper/foo/bar/file.pdf ? Try ls uploads/paper/foo/bar/file.pdf in terminal Mar 30, 2015 at 17:11
  • File is there. I tested this.
    – kitz
    Mar 30, 2015 at 17:17

1 Answer 1

1

This probably due to config.serve_static_files is not set to true in config/enviroments/development.rb or whichever environment you are running (defaults to true for development and false for production)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.