This is a question that, I think,. straddles both Ruby and RoR. I’m
gonna post it here.
In some sample code, I see the following in the section:
<%= yield(:head) %>
I see that the yield is returning something (i.e. “:head”) … but why?
And to whom? How can I tell?
<%= yield(:head) %> (presumably in one of your layouts) yields to any
view
doing something like
<% content_for :head do -%>
This text will be in the location of the html where
<%=yield(:head)%>
is
<% end %>
This is useful for doing things like include genormous javascript
libraries
like tinymce only when needed in views that are editing with wysiwyg
text
boxes.
-ben