documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

Adding path changes all JST paths #253

Closed crystalneth closed 9 years ago

crystalneth commented 10 years ago

If my assets.yml looks like this:

project_templates:

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

If I then add another path, like:

project_templates:

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 commented 10 years ago

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 commented 9 years ago

Dup of #192.