Skip to content

Instantly share code, notes, and snippets.

@mlomnicki
Created September 22, 2009 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlomnicki/191256 to your computer and use it in GitHub Desktop.
Save mlomnicki/191256 to your computer and use it in GitHub Desktop.
def find_family_view_for_state_with_caching(state, action_view)
return find_family_view_for_state(state, action_view) unless ActionController::Base.perform_caching
key = "#{state}/#{action_view.template_format}"
self.class.state2view_cache[key] ||= find_family_view_for_state(state, action_view)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment