lib/stache/asset_helper.rb in stache-1.0.3 vs lib/stache/asset_helper.rb in stache-1.1.0

- old
+ new

@@ -12,13 +12,11 @@ lookup_context.find(source, [], partial, [], { formats: [:html] }) end end template = template_finder.call(true) rescue template_finder.call(false) - template_id = source.split("/").last - - options = options.reverse_merge(:type => "text/html", :id => "#{template_id.dasherize.underscore}_template") - content_tag(:script, template.source.html_safe, options) + template_id = (Stache.include_path_in_id) ? source.gsub("/", '_') : source.to_s.split("/").last + content_tag(:script, template.source.html_safe, options.reverse_merge(type: 'text/html', id: template_id.dasherize.underscore)) end.join("\n").html_safe end end