# Defaults js and caching problem

**URL:** <https://www.ruby-forum.com/t/defaults-js-and-caching-problem/142786>\
**Category:** Rails\
**Created:** [July 11, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/defaults-js-and-caching-problem/142786 "2008-07-11T14:59:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [July 11, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/defaults-js-and-caching-problem/142786/1 "2008-07-11T14:59:13Z")

</div>

Hi,

I’m trying to cache my stylesheets and javascripts. I’m in production  
mode.

Everything looks ok with the stylesheets.

\<%= stylesheet\_link\_tag :all, :cache =\> true %\>  
Is generating all.css that contains two css files I use.

But with js I’m having a problem. What I use without caching is:

\<%= javascript\_include\_tag :defaults %\>  
\<%= javascript\_include\_tag :prototype %\>  
\<%script src="/javascripts/scriptaculous.js"  
type=“text/javascript”%\>\<%/script%\>

What I try to use for caching is:

\<% =javascript\_include\_tag ‘defaults’, ‘prototype’,  
‘rounded\_corners\_lite.inc’, ‘scriptaculous’, :cache =\> ‘scripts’ %\>

And it doesn’t work.

I’ve tried to use:

\<%= javascript\_include\_tag ‘graphics’, ‘videobox’, ‘application’,  
‘builder’, ‘controls’, ‘dragdrop’, ‘effects’, ‘slider’, ‘sound’,  
‘prototype’,  
‘rounded\_corners\_lite.inc’, ‘scriptaculous’, :cache =\> ‘scripts’ %\>

Where I explicitely tell what I think defaults contain.

* * *

My app complains about methods that are actually contained in  
‘videobox.js’ and ‘application.js’. Both of them are fetched by the  
client based on firebug…

Any hints someone?

Thanks.

---

<div class="post-metadata">

**Author:** ![comopasta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@comopasta](https://www.ruby-forum.com/u/comopasta)\
**Post date:** [July 11, 2008, 10:44pm UTC](https://www.ruby-forum.com/t/defaults-js-and-caching-problem/142786/2 "2008-07-11T22:44:15Z")

</div>

Hi,

If anyone is interested I’m now using:

\<%= javascript\_include\_tag :defaults, :cache =\> ‘defatuls’ %\>

At least now it works and I suposse is caching the js.

Cheers.
