What I Learned Today

I've got this legacy site I'm working on with a CMS-like Rails tool that works like this: you edit page templates and pages through the admin backend, and these page templates and pages are written to disk, not as cached compiled pages, but as views. The page template about would be in app/views/layouts/generated/about.html.erb, for example.

We upgraded to Rails 2.3.2 on this site recently, and the CMS quit working correctly. We could edit the templates, but the rendered HTML stayed the same, even though the template changed on disk. I thought this might be caching somewhere. What I found in the end was this note in the actionpack changelog under 2.2.0:

Do not stat template files in production mode before rendering. You will no longer be able to modify templates in production mode without restarting the server.

So that's not good for this specific use case. (There's reasons its good for other use cases.) I've got to figure out how to selectively work around this tomorrow. I spent a good hour on it today, but got stuck.

Published: 15 Jun 2009