Skip to content

Instantly share code, notes, and snippets.

@heijmerikx
Forked from billymeltdown/application.html.haml
Created September 15, 2010 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heijmerikx/581403 to your computer and use it in GitHub Desktop.
Save heijmerikx/581403 to your computer and use it in GitHub Desktop.
!!! 5
%html
%head
%title= 'Zetetic - ' + yield_for(:title, 'Blog')
%meta{:name => 'description', :content => yield_for(:description, "blarf blarf dorf dorf dorf, hooray it's our blog!")}/
...
module ApplicationHelper
def yield_for(content_sym, default)
output = content_for(content_sym)
output = default if output.blank?
output
end
end
- content_for(:title, @article.title )
- content_for(:description, @article.lede )
= render @article
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment