Created
August 19, 2011 09:12
-
-
Save dnagir/1156409 to your computer and use it in GitHub Desktop.
HAML example with pakunok gem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-# 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