I'm using this line:
= javascript_include_tag :all, :recursive => true, :cache => true
in the footer of a Rails app to do the following:
- Load all the scripts under public/javascripts recursively
- In production, lump them all into one file (the
:cachepart)
However, I want to load one of these scripts in the head, because some inline JS depends on it.
Is there an option for javascript_include_tag to exclude files that have already been loaded?
I know it doesn't do this by default, because right now I see a script referenced twice in the source HTML.
/public(not/public/javascripts). So I can dojavascript_include_tag '/myscript.js'at the top, and the recursive load at the bottom doesn't find it.