4 ms·
It is to some extent, the problem is in the semantic <%= render "foo" %> may end up rendering different partials based the context it's invoked from, e.g. curre
by byroot 4y ago
It is to some extent, the problem is in the semantic <%= render "foo" %> may end up rendering different partials based the context it's invoked from, e.g. current locale, etc.
So the cache can't just be a simple hash.
Additionally, once you have identified the template to render, if some locals are passed, you then need to lookup the compiled template for that specific combination of parameters, because `render "foo"` and `render "foo", name: "George"` end up compiling two versions of the same template.
For that later issue we just introduced a way to declare what locals a template accept which should allow us to improve that part: https://github.com/rails/rails/pull/45602 https://github.com/rails/rails/pull/45602
- kayodelycaon 4y agoThis is awesome. I’m going to use the heck out of this feature. I’ve been sticking # required: at top of my templates.