Skip to content

Instantly share code, notes, and snippets.

@trooney
Last active August 29, 2015 14:04
Show Gist options
  • Save trooney/0cecd0d64aaae6ac5cda to your computer and use it in GitHub Desktop.
Save trooney/0cecd0d64aaae6ac5cda to your computer and use it in GitHub Desktop.
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
@muloka
Copy link

muloka commented Jul 28, 2014

this is awesome 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment