Today I ran into one of the weirdest issues I ever ran into the past 6 years.
In Alchemy CMS we use rails action caching to cache the content of pages. This worked fine for rails 2.x. But now we finally made the switch to rails 3.1 we had an weird issue with action caching.
Although we passed :layout => false to caches_action the whole layout was always cached together with the action. After nearly 5 hours of debugging and swearing I found the solution.
In the show action (the action we are caching, obviously) we call
(layout_for_page returns either application.html.erb if present, or alchemy/pages.html.erb if not).
After removing this everything worked fine. But how do we ensure our feature is still working?
I use the layout class method and pass the method name as symbol:
Rails evaluates this method and uses the return value as layout.