There's no need to create any extra function/helper. You should have a look to the documentation.
In the application layout
<% if content_for?(:title) %>
<%= content_for(:title) %>
<% else %>
Default title
<% end %>
In the specific layout
<% content_for :title do %>
Custom title
<% end %>