content_for?(name) public

content_for? checks whether any content has been captured yet using content_for. Useful to render parts of your layout differently based on what is in your views.

<%# This is the layout %>
<html xmlns="" xml:lang="en" lang="en">
  <title>My Website</title>
  <%= yield :script %>
<body class="<%= content_for?(:right_col) ? 'two-column' : 'one-column' %>">
  <%= yield %>
  <%= yield :right_col %>
Show source
Register or log in to add new notes.