E
E
eldar_web2015-10-08 17:29:17
Ruby on Rails
eldar_web, 2015-10-08 17:29:17

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

2 answer(s)
J
Jeiwan, 2015-10-08
@eldar_web

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.

A
Anton Radushevsky, 2015-10-08
@doromones

have daddy public
in her and lie down

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question