Created
May 26, 2010 16:43
-
-
Save billymeltdown/414725 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- content_hash[:header] = capture_haml do | |
:textile | |
h1(strip). About Strip | |
p(intro). Credits & Copyrights | |
Thank you for your interest in Strip! This page contains legal information and serves to give credit where credit is due. | |
/ main content | |
:textile | |
h3. SQLCipher - Encryption | |
Strip's encryption engine, "SQLCipher":/software/sqlcipher, is a free and open source variant of "SQLite":http://www.sqlite.org, the popular embedded database engine. SQLCipher uses OpenSSL to provide transparent, page-level encryption. SQLCipher is © 2008-2009 Zetetic LLC, all rights reserved, and is also free and open source software. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!!! | |
%html | |
%head | |
= stylesheets | |
%body | |
#header | |
= yield_for(:header) | |
#content | |
= yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SiteHelper | |
attr_accessor :content_hash | |
def content_hash | |
@content_hash ||= {} | |
end | |
def yield_for(index) | |
output = self.content_hash[index.to_sym] | |
output = "" if output.nil? | |
output | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Method for faking Rails'
content_for
helper and the use of yield with varying symbols to yield alternative content in a staticmatic layout document.