mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: HTMLBars compilation was broken in production mode
This commit is contained in:
@ -3,11 +3,11 @@ module Ember
|
||||
class Template < Tilt::Template
|
||||
|
||||
# Wrap in an IIFE in development mode to get the correct filename
|
||||
def compile_ember_handlebars(string)
|
||||
def compile_ember_handlebars(string, ember_template = 'Handlebars')
|
||||
if ::Rails.env.development?
|
||||
"(function() { try { return Ember.Handlebars.compile(#{indent(string).inspect}); } catch(err) { throw err; } })()"
|
||||
"(function() { try { return Ember.#{ember_template}.compile(#{indent(string).inspect}); } catch(err) { throw err; } })()"
|
||||
else
|
||||
"Handlebars.compile(#{indent(string).inspect});"
|
||||
"Ember.#{ember_template}.compile(#{indent(string).inspect});"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user