Skip to content

Instantly share code, notes, and snippets.

@talbright
Last active August 29, 2015 14:09
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 talbright/96b28d31845e50d6fd1a to your computer and use it in GitHub Desktop.
Save talbright/96b28d31845e50d6fd1a to your computer and use it in GitHub Desktop.
Rails: check for fragment key outside of controller
action_base = ActionController::Base.new
key = "en/handlebars_ticket_filter_show_v2/ssl:false"
action_base.fragment_exist?(key)
action_base.read_fragment(key)
action_base.fragment_cache_key(key) # shows how Rails modifies the key before storage see ActiveSupport::Cache.expand_cache_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment