ContentHelper¶
This feature requires version 2.0 or higher.
Provides a set of helpers for capturing and working with your page content in a more effective way.
has_content? and content_for¶
The has_content? helper is a natural fulfillment for the original <tt>content_for</tt> helper.
Returns true if given name has any content, in other workds if content_for(name) has ever been called.
<% content_for :foo do %> <div>This is a foo content.</div> <% end %> <% has_content? :foo # => true %> <% has_content? "foo" # => true %>