This project is archived and is in readonly mode.
write_fragment should return content when caching is disabled
Reported by Brian Johnson | August 16th, 2008 @ 05:48 PM | in 2.x
def write_fragment(key, content, options = nil)
return unless cache_configured?
key = fragment_cache_key(key)
self.class.benchmark "Cached fragment miss: #{key}" do
cache_store.write(key, content, options)
end
content
end
line 2 should be return content unless cache_configured? Otherwise something like this render :json => write_fragment(key, some json data) will receive a nil value for render and look for an action.json.erb file instead of returning the non-cached value of content
Comments and changes to this ticket
-
josh November 22nd, 2008 @ 07:16 PM
- State changed from new to open
-
Repository November 22nd, 2008 @ 07:22 PM
- State changed from open to resolved
(from [20d6fdd2567b44fc7de9768a6dedd50d2ea9c4ce]) write_fragment returns content if caching is disabled [#846 state:resolved] http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Referenced by
- 846 write_fragment should return content when caching is disabled (from [20d6fdd2567b44fc7de9768a6dedd50d2ea9c4ce]) write_f...