Skip to content

Instantly share code, notes, and snippets.

@ahawkins
Created December 30, 2010 02:26
Show Gist options
  • Save ahawkins/759381 to your computer and use it in GitHub Desktop.
Save ahawkins/759381 to your computer and use it in GitHub Desktop.
# handles cached actions and fragments with easy
def write_fragment(key, content, options = nil)
if options[:tag]
tags = options[:tag].is_a?(Array) ? options[:tag] : [options[:tag]]
tags.each do |tag|
some_redis.sadd tag, fragment_cache_key(key)
end
end
super
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment