Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
HAML example with pakunok gem
// app/assets/javascripts/application.js
// Include the template into the app
//= require_tree backbone/templates
// And here's how you do the templating
var html = JST.comment(commentModel.attributes);
$(".comments").append(html);
// Or as one liner:
$(".comments").append( JST.comment(commentModel.attributes) );
-# app/assets/javascripts/backbone/templates/comment.js.hamljs
.comment
.author= author
.text= text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment