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
{{ message }}
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
We're building an application that allows the users to create their own templates for sections of the app. This is similar to Shopfiy or Wordpress - users can create themes which have multiple templates.
However this makes it hard to deal with the explicit dependencies in cache_digests. The format <%# Template Dependency: todolists/todolist %> doesn't allow for a dynamically changing set of template dependencies.
I was wondering whether a proc would be a reasonable way to return a set of templates that the container template depends on?
<%# Template Dependency: { | h | h.return_dependent_templates } %>
It's taking me a while to wrap my head around the implications of this and whether this in fact the right approach or whether it just starts to break everything from the inside out. I wanted to just raise it and see your thoughts.
The text was updated successfully, but these errors were encountered:
peternixey
changed the title
Would it make sense to accept a proc for external dependencies?
Would it make sense to accept a proc as a way to specify explicit dependencies?
Jul 3, 2014
I'm self-closing this on the premise that the templates are either
a) a part of the file system in which case you can manually add them in using the commenting
or
b) completely dynamic and stored in the database in which case they can just be treated as if they were any other piece of data.
We're building an application that allows the users to create their own templates for sections of the app. This is similar to Shopfiy or Wordpress - users can create themes which have multiple templates.
However this makes it hard to deal with the explicit dependencies in cache_digests. The format
<%# Template Dependency: todolists/todolist %>
doesn't allow for a dynamically changing set of template dependencies.I was wondering whether a proc would be a reasonable way to return a set of templates that the container template depends on?
<%# Template Dependency: { | h | h.return_dependent_templates } %>
It's taking me a while to wrap my head around the implications of this and whether this in fact the right approach or whether it just starts to break everything from the inside out. I wanted to just raise it and see your thoughts.
There's another example of a slightly different version of this problem in this stack overflow question.
The text was updated successfully, but these errors were encountered: