documentcloud / jammit

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

cannot pass parameters to JavaScript files #41

Closed kjvarga closed 14 years ago

kjvarga commented 14 years ago

If I include a '?' in the JS file path, the asset is no longer included in the HEAD. I want to pass a variable to a local script indicating a state e.g.

default_js:

Cheers, Karl

vandrijevik commented 14 years ago

Karl, the reason ajax.js is no longer included in the package when you specify ajax.js?enabled=false is that a file with the filename ajax.js?enabled=false does not exist.

This is correct and desired behaviour, the paths in assets.yml are Dir.glob patterns, not HTTP paths with params.

jashkenas commented 14 years ago

Hey Karl. Vladimir is quite right. When Jammit runs, it uses directory globs against the files present in the filesystem, not HTTP requests against a local server. Rails doesn't event have to be running at the time.

So, sorry that you can't customize the packaged JS with query params, but there's probably another way to go. You can certainly have different JS included in different environments, if that's what you're trying to do.

http://documentcloud.github.com/jammit/#configuration