Created
October 13, 2011 18:26
-
-
Save rodriguezartav/1285037 to your computer and use it in GitHub Desktop.
config/initializers/stitch.rb it setups stitch to compile and include javascript applications templates in the main app file
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 characters
class TmplCompiler < Stitch::Compiler | |
extensions :tmpl | |
def compile(path) | |
content = File.read(path) | |
%{var template = jQuery.template(#{content.to_json}); | |
module.exports = (function(data){ return jQuery.tmpl(template, data); });} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment