documentcloud / jammit

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

Always Namespace Templates #102

Closed loe closed 13 years ago

loe commented 13 years ago

Using the following assets.yml I run into issues:

javascripts: workspace: -- app/views/workspace/user.html.mustache

patron: -- app/views/patron/user.html.mustache

Both of these packages try to create user at the top level of the JST object, the work around seems to be to reference an empty file in a different path so the namespacing takes place. I think since the JST object is global it should always be namespaced.

loe commented 13 years ago

It seems like find_base_path is the logic that should be removed, or it should have to know about ALL the paths in the entire assets.yml, not just the local package.

jashkenas commented 13 years ago

That is, indeed, a problem. But I'm not so sure that the logic here should be changed. Keeping patch prefixes specific to asset packages allows you to set up asset packages with a desired level of granularity. And, changing the current behavior would be a backwards-incompatible change.

So, I recommend that you either rename one of your templates, or drop it in to a more specific folder.