Suppose I have a file "example.txt", which lives in my assets/files folder in my Rails app. On production, I can access this file via the url '/assets/example.txt'
How can I set up my routes.rb file so that I can access the contents of example.txt when I simply visit 'example.txt'?
The easiest method is to place the file in your public directory. By default this serves static assets in most cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With