Adding Jammit::Packager#includes? to detect existence of compiled assets.#246
Adding Jammit::Packager#includes? to detect existence of compiled assets.#246andrewhao wants to merge 2 commits intodocumentcloud:masterfrom
Conversation
… to determine whether an asset can be expected in Jammit.
…ed tests. Coerce inputs to symbols.
|
Tell us a bit about your use case, please. |
|
@jashkenas: I'm stuck in a Rails 2 app which on a per-controller basis loads in a custom stylesheet/script tag. Say I need to load "admin.js". Now in a |
|
Sounds pretty special case. Can't you just define these custom asset packages, and use them? Too many? Even to do in a loop in ERB in your assets.yml? |
|
@jashkenas Yep, those are all valid alternatives. I just thought it'd be nice to add an extra layer of abstraction so I didn't have to know about Jammit configuration implementation. What are your concerns? I could perhaps extract this method into a new |
This allows us to detect the existence of a packaged asset at runtime, and gives us the ability to determine whether to call the Jammit stylesheet/javascript helper or the default Rails tag helpers.