Skip to content

Instantly share code, notes, and snippets.

@kamk
Created April 4, 2010 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kamk/355667 to your computer and use it in GitHub Desktop.
Save kamk/355667 to your computer and use it in GitHub Desktop.
require 'ember'
module Ember
module RailsHelper
@@options = { :unindent => true, :shorthand => true }
def self.options
@@options
end
def process_template(input)
Ember::Template.new(input, @@options).program
end
end
end
module ActionView
module TemplateHandlers
class EmberHandler < TemplateHandler
include Compilable
include Ember::RailsHelper
def compile(template)
# template.is_a?(ActionView::Template)
process_template(template.source)
end
end
end
handler_klass = TemplateHandlers::EmberHandler
Template.register_default_template_handler :erb, handler_klass
Template.register_template_handler :rhtml, handler_klass
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment