Skip to content

Instantly share code, notes, and snippets.

@dnagir
Created August 19, 2011 09:12
Show Gist options
  • Save dnagir/1156409 to your computer and use it in GitHub Desktop.
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