Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

I fixed issue #23 that I reported - template_name is the full path to template? #24

Merged
merged 2 commits into from

2 participants

@cw-moshe

(This is my first time trying to fix using pull request on github)

@leshill leshill merged commit 9f5d510 into leshill:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/handlebars_assets/tilt_handlebars.rb
View
4 lib/handlebars_assets/tilt_handlebars.rb
@@ -11,14 +11,14 @@ def evaluate(scope, locals, &block)
compiled_hbs = Handlebars.precompile(data)
if name.start_with?('_')
- partial_name = name[1..-1].inspect
+ partial_name = scope.logical_path.gsub(/^templates\/(.*)$/i, "\\1").gsub(/\//, '_').gsub(/__/, '_').inspect
<<-PARTIAL
(function() {
Handlebars.registerPartial(#{partial_name}, Handlebars.template(#{compiled_hbs}));
}).call(this);
PARTIAL
else
- template_name = scope.logical_path.inspect
+ template_name = scope.logical_path.gsub(/^templates\/(.*)$/i, "\\1").inspect
<<-TEMPLATE
(function() {
this.HandlebarsTemplates || (this.HandlebarsTemplates = {});
Something went wrong with that request. Please try again.