Created
October 29, 2014 14:35
-
-
Save cowboyd/e4f2ae72ee986358a6ff to your computer and use it in GitHub Desktop.
Using Precompiled Templates from Ruby
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
require 'handlebars' | |
# reopen this class to give access to the | |
# underlying runtime | |
class Handlebars::Context | |
attr_reader :js | |
end | |
context = Handlebars::Context.new | |
template = context.js.eval my_precompiled_template | |
template.call foo: 'bar' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment