2013-11-22 17:47:07 +01:00
|
|
|
<% content_for :demo do %>
|
|
|
|
<h1>This is content yielded from a content_for</h1>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class='demo'><%= yield_content :demo %></div>
|
|
|
|
|
|
|
|
<% content_for :demo2 do |fname, lname| %>
|
|
|
|
<h1>This is content yielded with name <%= fname + " " + lname %></h1>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class='demo2'><%= yield_content :demo2, "Johnny", "Smith" %></div>
|
|
|
|
|
|
|
|
<div class="demo_has_content"><%= content_for?(:demo).to_s %>
|
2014-02-19 03:30:29 +01:00
|
|
|
<div class="fake_has_content"><%= content_for?(:fake).to_s %>
|
|
|
|
|
|
|
|
<% content_for :demo3 do %>
|
|
|
|
<p class="duplication">One</p>
|
|
|
|
<% end %>
|
|
|
|
<% content_for :demo3, :flush => true do %>
|
|
|
|
<p class="duplication">Two</p>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="demo3"><%= yield_content :demo3 %></div>
|