Skip to content

Instantly share code, notes, and snippets.

@stevenbristol
Created January 14, 2011 20:57
Show Gist options
  • Save stevenbristol/780229 to your computer and use it in GitHub Desktop.
Save stevenbristol/780229 to your computer and use it in GitHub Desktop.
def render_once options = nil, extra_options = {}, &block
@rendered_once ||= []
args = [options, extra_options]
return '' if args.in? @rendered_once
@rendered_once << args
render options, extra_options, &block
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment