lundi 23 mars 2015

Render handlebars template programmatically

Is it possible to render a Handlebars/Htmlbars-template programmatically inside the controller?


I'm rendering blog-posts and would like to have the ability to replace parts of their content with another HTMLBars-template?


e.g.


My blog post looks like this:



<h3>Lorem ipsum</h3>
<p>dolor sit amet</p>
[mycooltemplate]
<p>another line</p>


In the controller I'd look for [mycooltemplate] and have the same output as if I would invoke {{ render "mycooltemplate" }} or {{ partial "mycooltemplate" }}





Aucun commentaire:

Enregistrer un commentaire