Skip to content

Instantly share code, notes, and snippets.

@dnagir
Created August 19, 2011 09:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dnagir/1156409 to your computer and use it in GitHub Desktop.
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