Skip to content
  • Mike Dalessio's avatar
    b35a9b6f
    ActionView: Layouts can access local variables · b35a9b6f
    Mike Dalessio authored
    Local variable access was originally broken, reportedly, in Rails 5.1
    in d6bac046 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 4db7ae52, 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 #31680
    b35a9b6f
    ActionView: Layouts can access local variables
    Mike Dalessio authored
    Local variable access was originally broken, reportedly, in Rails 5.1
    in d6bac046 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 4db7ae52, 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 #31680
Loading