Created
May 27, 2010 01:41
Revisions
-
defunkt created this gist
May 27, 2010 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ require 'mustache' class Layout < Mustache self.template = "Header {{{yield}}} Footer" end class Index < Mustache self.template = "The Index." end class Profile < Mustache self.template = "The Profile." end def render(klass) view = Layout.new view[:yield] = klass.render view.render end puts "Index:" puts render(Index) puts puts "Profile:" puts render(Profile)