Created
April 4, 2010 20:29
-
-
Save kamk/355667 to your computer and use it in GitHub Desktop.
This file contains 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
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