Sha256: 0b876d2dcfcfa16a17d40d5dce402c7e9b2833336b032b380de669322d453afe
Contents?: true
Size: 479 Bytes
Versions: 35
Compression:
Stored size: 479 Bytes
Contents
module Coffee module Rails class TemplateHandler def self.erb_handler @@erb_handler ||= ActionView::Template.registered_template_handler(:erb) end def self.call(template) compiled_source = erb_handler.call(template) "CoffeeScript.compile(begin;#{compiled_source};end)" end end end end ActiveSupport.on_load(:action_view) do ActionView::Template.register_template_handler :coffee, Coffee::Rails::TemplateHandler end
Version data entries
35 entries across 34 versions & 8 rubygems