module MustacheTemplateHandler
  def self.call(template)
    if template.locals.include? :locals
      "Mustache.render(#{template.source.inspect}, locals).html_safe"
    else
      "#{template.source.inspect}.html_safe"
    end
  end
end
ActionView::Template.register_template_handler(:mustache, MustacheTemplateHandler)
ActionController::Base.view_paths << Rails.root.join('app', 'templates')
