public

  • Download Gist
rails_fragment_cache.rb
Ruby
1 2 3 4 5 6 7 8
fragment_cache = read_fragment(fragmentname)
 
if(not fragment_cache)
fragment_cache = Sparklines.plot(ary,params)
write_fragment(fragmentname,fragment_cache)
end
 
send_data(fragment_cache, :disposition => 'inline', :type => 'image/png')

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.