Let's say I need to call a javascript file in the <head> of an ERb template. My instinct is to do the usual:
<head> <%= javascript_include_tag :defaults %> </head>
in my application layout. The problem, of course, is that these javascript files are uploaded to every page of my application, regardless of whether they are needed or not for the page being viewed.
So I'm wondering if there is a good way to load javascript into headers, for example, all ERb templates found only in a specific directory.
javascript ruby-on-rails header rjs
btw Dec 23 '08 at 21:48 2008-12-23 21:48
source share