Answer the question
In order to leave comments, you need to log in
How to open a text file located in the root directory in Ruby on Rails by url?
There is, for example, a text file delo.txt with content. And I throw it into the root directory of the site, and I want to open it at site.ru/delo.txt, and then they show errors (the routes swear).
How can you open this file at site.ru/txt?
It doesn't matter where this file is located, I can upload it, for example, to the public folder, the main thing is how to open it at the address that I wrote above?
Answer the question
In order to leave comments, you need to log in
Static is usually given by nginx: https://www.nginx.com/resources/admin-guide/servin...
You can also make some kind of StaticController, it contains a txt action that opens a file and renders it in response.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question