Skip to content

Instantly share code, notes, and snippets.

@aheckmann
Created March 20, 2010 20:54
Show Gist options
  • Save aheckmann/338899 to your computer and use it in GitHub Desktop.
Save aheckmann/338899 to your computer and use it in GitHub Desktop.
// partial example
/**
folder structure
/views
- home.haml.html
/partials
- world.haml.html
- xclaimation.haml.html
// home.haml.html
!!!html
%title Test
%body
%h1 Hello
#w= this.partial("world.haml.html")
// world.haml.html
%em= "World" + this.partial("xclaimation.haml.html")
// xclaimation.haml.html
!!!!!!
*/
// route
get("/", function() {
this.render("home.haml.html")
})
// output
<!doctype html>
<title>Test </title>
<body>
<h1>Hello </h1>
<div id="w"><em>World!!!!!!</em></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment