M
M
Matvey Mamonov2016-05-01 20:46:24
Ruby on Rails
Matvey Mamonov, 2016-05-01 20:46:24

Why does Rails precompile essays?

Do I understand correctly that the precompilation of assets by a Rails application is needed in order to "translate" scss code and coffee code into css and js code, respectively?
That is, if I refuse to use coffee scripts and scss markup, then no precompilation will occur?
And one more thing: if there are scripts in both coffee and js formats, will Rails only precompile coffee?
PS How much does precompilation increase page load time? How beneficial is it to use? Is it worth sacrificing page load time for development convenience?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Andreev, 2016-05-01
@eucalipt

In a development environment, assets are recompiled on-the-fly when the page changes and refreshes.
In a production environment, all your Coffee and SCSS will be minified, compiled, and merged into two static JS and CSS files neatly folded into the public/asssets/ folder

Z
Zaporozhchenko Oleg, 2016-05-04
@c3gdlk

In addition, during the compilation process, a digest will be added to the file name - a hash that guarantees that the user will update the cached assets. Therefore, we must not forget to use image-url and other helpers in Saas files

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question