<%= 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
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> .
> 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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.