When does Rails compile Coffeescript resources to JavaScript? Does it happen on-demand or at startup?
When does Rails compile Coffeescript resources to JavaScript? Does it happen on-demand or at
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CoffeeScript compiles to JavaScript on demand when a request is made to a view that includes a CoffeeScript resource.
However, you can use the following to have CoffeeScript compile to JavaScript ahead of time:
See this link for more information on the Rails asset pipeline.
From the link:
…
…
UPDATE:
For those interested in precompiling assets for development, set the RAILS_ENV variable to development first (from here):