Last active
August 29, 2015 14:04
-
-
Save trooney/0cecd0d64aaae6ac5cda 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
def yield_placeholder(name, content = nil, &block) | |
if content_for?(name) | |
concat @view_flow.get(name) | |
else | |
if block_given? | |
content = capture(&block) | |
end | |
concat content | |
end | |
end | |
def yield_block(name, content = nil, &block) | |
unless content_for?(name) | |
content_for(name) do | |
if block_given? | |
content = capture(&block) | |
end | |
content | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is awesome 👍