Calling #content_for
stores a block of markup in an identifier for later use. In order to access
this stored content in other templates, helper modules or the layout, you
would pass the identifier as an argument to content_for.

Note: yield can still be used to retrieve the stored content,
but calling yield doesn't work in helper modules, while
content_for does.

<% content_for :not_authorized do %>
alert('You are not authorized to do that!')
<% end %>

You can then use content_for :not_authorized anywhere in your
templates.

The same as content_for but when used with streaming flushes
straight back to the layout. In other words, if you want to concatenate
several times to the same buffer when rendering a given template, you
should use content_for, if not, use provide to
tell the layout to stop looking for more contents.