Say I need to call a javascript file in the of an ERb template.
My instinct is to do the usual:
<%= javascript_incl
I would suggest not to add javascript in the header as it causes to load the page slower. Rather load the js at the bottom of the page, which is faster. http://developer.yahoo.com/performance/rules.html#js_bottom
....
<%= yield(:js) -%>
And send it there from a view:
<%- content_for(:js) do -%>
<%= javascript_include_tag :defaults -%>
<%- end -%>