Conversation

When passing local variables to sub-templates, the variables can be accesses using local_assigns. This part of the documentation was removed in the commit 3dfcae6.

In earlier versions, defined? foo did not work reliably, so local_assigns was the recommended way to check if a local variable has beed defined. Now defined? works, and can be used safely, but local_assigns is still available and useful in some scenarios, such as:

This was also brought up by @dhh in another issue today: #18962. It's especially confusing since the only mention of local_assigns was removed from the documentation even though the feature is still available. I've written up more about this here.