+ //
<%= user.name %>
+ // <% if (user.photo_url) { %>
+ //
+ // <% } %>
+ //
+ //
+ // Given that is a publicly accesible file, you would render it like:
+ //
+ // $.sammy(function() {
+ // // include the plugin
+ // this.use(Sammy.Template);
+ //
+ // this.get('#/', function() {
+ // // the template is rendered in the current context.
+ // this.user = {name: 'Aaron Quint'};
+ // // partial calls template() because of the file extension
+ // this.partial('user.template');
+ // })
+ // });
+ //
+ Sammy.Template = function(app) {
+
+ app.helpers({
+ // *Helper:* Uses simple templating to parse ERB like templates.
+ //
+ // === Arguments
+ //
+ // +template+:: A String template. '<% %>' tags are evaluated as Javascript and replaced with the elements in data.
+ // +data+:: An Object containing the replacement values for the template.
+ // data is extended with the