In a Haml based Padrino solution I have an application.haml
like this:
!!!
%html
%head
%title "blah"
%body
#header
= yield_content :headcontent
#container
...
For :headcontent
, in my page (e.g. index.haml
) I have
- content_for :headcontent do
#headcontent
%h2= "Index header stuff"
#content
...
What I want to do is make it so that content pages like index.haml
can optionally specify - content for :headcontent
. That is I want application.haml
to contain some default :headcontent
that only is rendered if a page does not do - content for :headcontent
.
How do I do this?