# Re: tags, ActionView::Helpers, caching: trying to make a sho

**URL:** <https://www.ruby-forum.com/t/re-tags-actionview-helpers-caching-trying-to-make-a-sho/92828>\
**Category:** Radiant CMS\
**Created:** [April 24, 2007, 6:42pm UTC](https://www.ruby-forum.com/t/re-tags-actionview-helpers-caching-trying-to-make-a-sho/92828 "2007-04-24T18:42:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kozy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7ea924/32.png) [@kozy](https://www.ruby-forum.com/u/kozy)\
**Post date:** [April 24, 2007, 6:42pm UTC](https://www.ruby-forum.com/t/re-tags-actionview-helpers-caching-trying-to-make-a-sho/92828/1 "2007-04-24T18:42:34Z")

</div>

that clears things up quite a bit, thanks.

It appears however you’ve missed my question about caching.

is it prossible to inject a small piece of evaluated code in the  
template  
for the shopping cart? Or do I need to disable caching completly for  
this?  
I’d like to display the users shopping cart on every page. Is it  
possible  
to disable the cache for users who have something in the shoppping cart?

If I want to continue using radiant for my site maybe I need to  
implement  
it myself? Can I overwrite specific functions of the response\_cache  
model  
to process the returned cache, injecting an evaluated snippet or such.  
This might be very usefull for all kind of things.

---

<div class="post-metadata">

**Author:** ![kozy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7ea924/32.png) [@kozy](https://www.ruby-forum.com/u/kozy)\
**Post date:** [April 25, 2007, 6:50am UTC](https://www.ruby-forum.com/t/re-tags-actionview-helpers-caching-trying-to-make-a-sho/92828/2 "2007-04-25T06:50:35Z")

</div>

Hi,

How about injecting the shopping cart by javascript?  
I think this is not the best way, but easy.

1. add action “cart” into your controller. it returns like this:

cart = function() {$(‘cart’).innerHTML = ‘… shopping cart …’;}  
Event.observe(window, ‘load’, cart, false);

1. edit your template to load /shop/cart as javascript code and add

You can use cached page and uncached shopping cart by this way.

I think the cache mechanism of radiant should keep simple way.

* * *

Keita Y.

2007/4/25, kozy [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![kozy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7ea924/32.png) [@kozy](https://www.ruby-forum.com/u/kozy)\
**Post date:** [April 25, 2007, 4:14pm UTC](https://www.ruby-forum.com/t/re-tags-actionview-helpers-caching-trying-to-make-a-sho/92828/3 "2007-04-25T16:14:17Z")

</div>

yes, ‘kiss’ for faster results, probably 🙂

I think it might be nice now I think about it again…make a pretty  
spinner on loading.

Thanks people.
