You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have a template that uses lots of data from its struct, and I want to render individual blocks from the template (which also use the same data), there ends up being a lot of code duplication.
This is just a simple example, in a real application it's so much worse.
It would be nice if I could just take MyTemplate and tell it to render a specific block. Like:
MyTemplate { ... }.render_block("sidebar")
Conceptually, this could mean "render the full template, but discard everything from the HTML response that is not a part of the block", in terms of implementation. It may be a little more wasteful on CPU but it will save memory and clean up the code drastically.
Is something like this possible?
The text was updated successfully, but these errors were encountered:
If I have a template that uses lots of data from its struct, and I want to render individual blocks from the template (which also use the same data), there ends up being a lot of code duplication.
This is just a simple example, in a real application it's so much worse.
It would be nice if I could just take MyTemplate and tell it to render a specific block. Like:
MyTemplate { ... }.render_block("sidebar")
Conceptually, this could mean "render the full template, but discard everything from the HTML response that is not a part of the block", in terms of implementation. It may be a little more wasteful on CPU but it will save memory and clean up the code drastically.
Is something like this possible?
The text was updated successfully, but these errors were encountered: