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 use content_for.
For instance, specify the place to insert it in the application layout:
Merry Christmas! <%= yield(:head) -%>
And send it there from a view:
<%- content_for(:head) do -%> <%= javascript_include_tag :defaults -%> <%- end -%>