Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slash in partials cause error #268

Closed
dev-bjoern opened this issue Jun 29, 2012 · 2 comments
Closed

Slash in partials cause error #268

dev-bjoern opened this issue Jun 29, 2012 · 2 comments

Comments

@dev-bjoern
Copy link

Hi, I am using the runtime build of handlebars and trying to use a registered partial. I do:

 Handlebars.registerPartial("path/partialname", Handlebars.templates["path/partialname"])

If I use a slash in a partial name like so:

{{> path/partialname}}

I get the error

The partial path.partialname could not be found [...]/lib/handlebars/handlebars.runtime

The "/" seems to be substituted for a "." How can I use a "/" inside the partial without modifying the Handlebars.registerPartial call? Thx alot.

@dev-bjoern
Copy link
Author

// automaticly register all templates as partials, so we dont have to do it manually
// #190
// also convert slashes to dots in the template name because this is how
// handlebars resolves partial names.
_.each(Handlebars.templates, function(val, key){
var key = key.replace(///g, ".")
Handlebars.partials[key] = val
})

@wycats
Copy link
Collaborator

wycats commented Dec 24, 2012

Fixed in #389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants