We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b56455b commit fc6fa81Copy full SHA for fc6fa81
lib/jbuilder/jbuilder_template.rb
@@ -104,7 +104,13 @@ def _render_partial(options)
104
105
def _cache_key(key, options)
106
key = _fragment_name_with_digest(key, options)
107
- key = url_for(key).split('://', 2).last if ::Hash === key
+
108
+ if @context.respond_to?(:fragment_cache_key)
109
+ key = @context.fragment_cache_key(key)
110
+ else
111
+ key = url_for(key).split('://', 2).last if ::Hash === key
112
+ end
113
114
::ActiveSupport::Cache.expand_cache_key(key, :jbuilder)
115
end
116
0 commit comments