Hi,I've been using the following route handler to compile coffeescript on the fly:get '/javascripts/application.js' docoffee :applicationendBut I'd rather not do this in production and would rather compile it locally into a JavaScript file.The problem I then have is that the compiled JavaScript file gets used in development, rather than the coffeescript file that I'm editing. This is because a static JS file exists, so it gets served, before my route handler picks it up.The only way I can think of is to use some sort of conditional logic in the layout like this:<% = coffee :application if development? %><% if production? %><script src="/javascripts/application.js"><% end %>Has anybody got any better ways of doing this?cheers,DAZ--
You received this message because you are subscribed to the Google Groups "sinatrarb" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sinatrarb/-/TdLSJ4yGEykJ.
To post to this group, send email to sina...@googlegroups.com.
To unsubscribe from this group, send email to sinatrarb+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sinatrarb?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/sinatrarb/-/Tx2kpKR4-K4J.
It's arguably faster than other solutions since it recompiles when the file changes, not when the request is made. But you know, use whatever works for you.