<%= yield(:head) %> (presumably in one of your layouts) yields to any view
doing something like

<% content_for :head do -%>
   <p>This text will be in the location of the html where <%=yield(:head)%>
is</p>
<% 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


On Mon, Feb 22, 2010 at 10:25 AM, Ralph Shnelvar <[email protected]>wrote:

> 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 <head> section:
>
>    <%= yield(:head) %>
>
> I see that the yield is returning something (i.e. ":head") ... but why?
> And to whom?  How can I tell?
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to