mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Many fixes for Ember 1.9.0
This commit is contained in:
16
lib/freedom_patches/better_handlebars_errors.rb
Normal file
16
lib/freedom_patches/better_handlebars_errors.rb
Normal file
@ -0,0 +1,16 @@
|
||||
module Ember
|
||||
module Handlebars
|
||||
class Template < Tilt::Template
|
||||
|
||||
# Wrap in an IIFE in development mode to get the correct filename
|
||||
def compile_ember_handlebars(string)
|
||||
if ::Rails.env.development?
|
||||
"(function() { try { return Ember.Handlebars.compile(#{indent(string).inspect}); } catch(err) { throw err; } })()"
|
||||
else
|
||||
"Handlebars.compile(#{indent(string).inspect});"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user