Browse files

oops, this was a WIP file that wasn't supposed to be checked in.

  • Loading branch information...
1 parent 5ea1c71 commit f138a7ae8f3755e4e0295f4a63324c64213c5cb6 @bryanlarsen bryanlarsen committed May 2, 2012
Showing with 0 additions and 39 deletions.
  1. +0 −39 hobo_rapid/taglibs/cache/item_cache.dryml
39 hobo_rapid/taglibs/cache/item_cache.dryml
@@ -1,39 +0,0 @@
-<!-- `<item-cache>` let's you use the cache infrastructure to store values
-### Attributes
-All extra attributes are used as cache keys.
-`query-params`: A comma separated list of query (or post) parameters
-used as non-hierarchical cache keys.
-`route-on`: Rails fragment caching uses the the current route to build
-its cache key. If you are caching an item that will be used in
-multiple different actions, you can specify route-on to ensure that
-the different actions can share the cache. You can pass either an
-object or a path to route-on. If you pass an object, it is converted
-to a path with `url_for`. If you specify route-on without a value,
-`this` is used. An alternative to using `route-on` is to specify
-`controller`, `action` and any other required path parameters
-explicitly. For example route-on="&posts_path" is identical to
-controller="posts" action="index". If you do not specify route-on or
-controller, action, etc., `params[:page_path]` or the current action
-is used.
-<def tag="cache" attrs="query-params,route-on"><%
- unless Rails.configuration.action_controller.perform_caching
- %><%= parameters.default %><%
- else
- key_key_s = hobo_cache_key(route_on, query_params)
- cache_content = key_key_s
- unless cache_content.nil?
- Rails.logger.debug "CACHE HIT #{key_key_s}"
- %><%= raw cache_content %><%
- else
- Rails.logger.debug "CACHE MISS #{key_key_s}"
- %><%= raw cache_content=parameters.default %><%
- Rails.cache.write(key_key_s, cache_content)
- end
- end

0 comments on commit f138a7a

Please sign in to comment.