Skip to content

Instantly share code, notes, and snippets.

@tylerhunt
Forked from stevenbristol/gist:780229
Created January 14, 2011 22:01
Show Gist options
  • Save tylerhunt/780346 to your computer and use it in GitHub Desktop.
Save tylerhunt/780346 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 @rendered_once.include?(args.hash)
@rendered_once << args.hash
render options, extra_options, &block
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment