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

Adding path changes all JST paths #253

Closed
crystalneth opened this issue Aug 16, 2013 · 2 comments
Closed

Adding path changes all JST paths #253

crystalneth opened this issue Aug 16, 2013 · 2 comments

Comments

@crystalneth
Copy link

If my assets.yml looks like this:

project_templates:
- app/templates/projects/.jst.haml
- app/templates/projects/index/
.jst.haml
- app/templates/projects/show/*.jst.haml

Then then a template in projects/show is compiled into JST['show/foo'].

If I then add another path, like:

project_templates:
- app/templates/projects/.jst.haml
- app/templates/projects/index/
.jst.haml
- app/templates/projects/show/.jst.haml
- app/templates/documents/shared/
.jst.haml

then the template in projects/show is compiled into JST['projects/show/foo'].

Is this behavior documented or avoidable? This makes going from a single path to multiple paths require modifying and testing a significant existing code, which is quite annoying.

It also seems like generally inconsistent and confusing behavior that discourages sharing code.

@crystalneth
Copy link
Author

I can see now in the docs:

"When including templates from different directories, the common prefix is ignored, and the rest of the path becomes the name of the template"

This is nightmare when refactoring since just trying to include one more template breaks lots of code.

@reefdog
Copy link
Contributor

reefdog commented Jun 30, 2015

Dup of #192.

@reefdog reefdog closed this as completed Jun 30, 2015
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