Skip to content

Instantly share code, notes, and snippets.

View tedb's full-sized avatar

Ted Behling tedb

View GitHub Profile
# Forked from user dirk; changed to drop the should_render boolean arg and
# replace it with a separate method, cache_and_render
class ApplicationController < ActionController::Base
# Other random stuff.
protected
def cache_and_render(key, opts = {})
cached = cache(key, opts)