cache_digests icon indicating copy to clipboard operation
cache_digests copied to clipboard

Jbuilder support

Open jims3ne1 opened this issue 11 years ago • 1 comments

I'm trying to use cache_digest gem with jbuilder (currently using Rails 3.x) I can't seem to make it work like this.

cache @videos do 
  json.partial! "api/videos/video", collection: @videos, as: :video
end

It throws an error:

NoMethodError - undefined method `length' for nil:NilClass: actionpack (3.2.18) lib/action_view/helpers/cache_helper.rb:52:in`fragment_for' cache_digests (0.3.1) lib/cache_digests/fragment_helper.rb:22:in `fragment_for'

jims3ne1 avatar Oct 09 '14 11:10 jims3ne1

Try, json.cache! @videos do

Overload119 avatar Sep 14 '15 17:09 Overload119