forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ActionView: Layouts can access local variables
Local variable access was originally broken, reportedly, in Rails 5.1 in d6bac04 which dropped the `locals` keys from some of the layout lookup methods to optimize the template resolver cache. In the meantime, the template resolver cache was discarded in Rails 7.0 in 4db7ae5, and was replaced by a FileSystemResolver cache that does not use the locals in the lookup key (because it's storing unbound templates). So this fix is, essentially, to once again pass the local variable names through the many layers of the layout resolver/renderer stack to make sure that when the unbound template is found and `#bind_locals` is called on it, it's bound with the proper set of local variable names. Fixes rails#31680
- Loading branch information
1 parent
bc601a9
commit b35a9b6
Showing
4 changed files
with
28 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters