Forum: Ruby on Rails Problem with javascript_include_tag with :cache

Posted by Thomas Nitsche (tnitsche)
on 2008-02-11 18:12
Hi,

I'm using the Rails 2 feature for asset packing, but I still can't
figure out how  Rails decides when to expire a cached asset package. I'm
using

<%= javascript_include_tag "prototype", "application", "effects",
"my_stuff"
                           :cache => "cache/site" %>

in my template, which becomes a

<script src="/javascripts/cache/site.js"
type="text/javascript"></script>

in the HTML. If I now update my_stuff.js, the only way to get the
changes "online" so far was deleting the cache/site.js and restart the
server - which is obviously a little bit rough. I tried to touch every
.js in my javascript dir, I touched the
corresponding RHTML template, no effect. I removed cache/site.js, but
then I get a "No route matches "/javascripts/cache/defaults.js" (which
is fairly understandable  on the other hand).

Any idea what's best practice here?

Cheers

Thomas
Posted by Mickael Faivre-Macon (micktaiwan)
on 2009-08-10 15:04
bump !
Posted by Mat Ellis (mate)
on 2009-12-04 00:19
bump!
Posted by Mat Ellis (mate)
on 2009-12-04 20:19
Found the solution here: http://bit.ly/5nkfNs
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.