rails/rails — pull request #8818 by jamis (2013-01-08 18:24:49+00:00)
Title: view_cache_dependency API

A declarative API for specifying dependencies that affect template
cache digest computation. In your controller, specify any of said
dependencies:

```ruby
class MyController < ApplicationController
view_cache_dependency { "phone" if using_phone? }
```

When a template is rendered the block is evaluated, and the resulting
value is included in the cache digest calculation, allowing you to generate
different digests for effectively the same template. (Mostly useful if you're
mucking with template load paths.)