Using thinkbot / high_voltage to serve static content

Does the high-voltage rail engine help serve static content that can be served from the nginx server, not the rail server.

How do I configure this?

+4
source share
1 answer

High voltage provides a way to organize and maintain static pages by providing a Rails-like interface to these pages through routes and controller actions. High voltage also allows you to protect these pages behind the Rails authentication code and displays the pages in a layout, so you do not need to duplicate headers and footers.

However, high voltage is very closely related to the Rails glass, and it is impossible to configure it to work without Rails.

If your goal is to serve static pages via nginx / Apache without going through the Rails structure, you better place them in a shared folder, for example. public/static_page.html and links to it directly, for example. yourdomain.com/static_page.html . One of the disadvantages of this is that you have to duplicate the headers and footers of the site. You will need to make sure that Rails is not a static asset service , but this is usually not a problem, since it is the default setting by default.

+2
source

Source: https://habr.com/ru/post/1379877/


All Articles