Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
MustacheHandler for Rails
class MustacheHandler < ActionView::Template::Handler
include ActionView::Template::Handlers::Compilable
# @return [String] its evaled in the context of the action view
# hence the hack below
#
# @param [ActionView::Template]
def compile(template)
mustache_class = ::Mustache
"#{mustache_class}.render('#{template.source}', assigns.merge(local_assigns)).html_safe"
end
end
ActionView::Template.register_template_handler(:mustache, MustacheHandler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.