Class: ActionView::TemplateHandlers::Ember

Inherits:
TemplateHandler
  • Object
show all
Includes:
Compilable
Defined in:
lib/ember/helpers/rails_helper.rb

Overview

Examples:

Setting processing options for Ember


ActionView::TemplateHandlers::Ember.options = {
  :unindent => true,
  :shorthand => true,
  :infer_end => true
}

See Also:

Constant Summary collapse

@@options =
{}

Instance Method Summary collapse

Instance Method Details

#compile(template) ⇒ Object



20
21
22
23
24
25
# File 'lib/ember/helpers/rails_helper.rb', line 20

def compile(template)
  options = @@options.merge(:result_variable => :@output_buffer,
                            :source_file => template.filename)
  ember = ::Ember::Template.new(template.source, options)
  "__in_erb_template = true; #{ember.program}"
end