Problem occurs where partial is rendered with explicit locals.
Subsequent rendering of that partial without those locals, or with
different locals, retains access to the previous keys (NOT values).
I've tracked the problem (if it is a problem) to
ActionView::Base.compile_template_source and the use of
The reason I question whether it is a genuine problem is because maybe
this is known and accepted for performance reasons.
Although, I'm not sure it is particularly problematic, it can cause
unexpected behviour. Example of unexpected behaviour..
* I have two actions, both of which render(:partial => 'my_partial').
The first renders with some locals that my_partial depends upon.
* I visit the first action (that sets locals) and see the partial correctly.
* I visit the second action (that doesn't set locals) and see the
partial correctly. * Unexpected - It should break.
* Restarting the webserver (or running a separate test that doesn't
first call the action with the locals) confirms that the second
action/partial combo is broken.
I'm incredibly unfamiliar with the templating stuff and so have
restrained from submitting some tests, although I do have an example
of showing that access to locals (note, access not the values) are
Any suggestions on what should be happening?