Skip to content
Browse files

Added simple partials support

  • Loading branch information...
1 parent 9e3a5ee commit c11ef379e18705c22d8aad78c4785eac58b69fa7 Joey Beninghove committed
Showing with 9 additions and 0 deletions.
  1. +7 −0 app/views/index.html.haml
  2. +1 −0 app/views/test.html.haml
  3. +1 −0 public/index.html
View
7 app/views/index.html.haml
@@ -1,3 +1,8 @@
+:ruby
+ def render_partial(path)
+ Haml::Engine.new(IO.read(path)).render
+ end
+
!!! 5
%html
%head
@@ -9,3 +14,5 @@
#container.container
%header
%h1 Fun, Have It!
+
+ = render_partial 'app/views/test.html.haml'
View
1 app/views/test.html.haml
@@ -0,0 +1 @@
+%h2 Partials!!!
View
1 public/index.html
@@ -11,6 +11,7 @@
<header>
<h1>Fun, Have It!</h1>
</header>
+ <h2>Partials!!!</h2>
</div>
</body>
</html>

0 comments on commit c11ef37

Please sign in to comment.
Something went wrong with that request. Please try again.