Skip to content

Instantly share code, notes, and snippets.

Avatar

Dingding Ye sishen

View GitHub Profile
@sishen
sishen / clean_eco_template.rb
Created Apr 11, 2012 — forked from doitian/clean_eco_template.rb
CleanEcoTemplate for Sprockets in Rails app
View clean_eco_template.rb
# Put this file in lib/
require 'sprockets/eco_template'
class CleanEcoTemplate < Sprockets::EcoTemplate
FROM = " (function() {"
TO = "}).call(__obj);"
def evaluate(scope, locals, &block)
content = Eco.compile(data)