<hobo-cache> is a simple fragment cache without the hierarchical dependency tracking used in <swept-cache> or <nested-cache>.


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.

Show Source

Edit this page