lib/handlebars/context.rb in handlebars-0.3.0 vs lib/handlebars/context.rb in handlebars-0.3.1
- old
+ new
@@ -18,10 +18,11 @@
@js.require('handlebars/utils')
for compiler_module in %w(ast base compiler index parser printer visitor)
@js.require("handlebars/compiler/#{compiler_module}")
end
@js.require('handlebars/runtime')
+ @partials = handlebars.partials = Handlebars::Partials.new
end
def compile(*args)
::Handlebars::Template.new(self, handlebars.compile(*args))
end
@@ -30,9 +31,13 @@
handlebars.registerHelper(name, fn)
end
def register_partial(name, content)
handlebars.registerPartial(name, content)
+ end
+
+ def partial_missing(&fn)
+ @partials.partial_missing = fn
end
def handlebars
@js.require('handlebars/base')
end
\ No newline at end of file