Class: Ember::Handlebars::Template
- Inherits:
-
Object
- Object
- Ember::Handlebars::Template
- Defined in:
- lib/freedom_patches/better_handlebars_errors.rb
Instance Method Summary collapse
-
#compile_ember_handlebars(string, ember_template = "Handlebars", options = nil) ⇒ Object
Wrap in an IIFE in development mode to get the correct filename.
Instance Method Details
#compile_ember_handlebars(string, ember_template = "Handlebars", options = nil) ⇒ Object
Wrap in an IIFE in development mode to get the correct filename
7 8 9 10 11 12 13 |
# File 'lib/freedom_patches/better_handlebars_errors.rb', line 7 def (string, ember_template = "Handlebars", = nil) if ::Rails.env.development? "(function() { try { return Ember.#{ember_template}.compile(#{indent(string).inspect}); } catch(err) { throw err; } })()" else "Ember.#{ember_template}.compile(#{indent(string).inspect}, #{.to_json});" end end |