Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10913 (new defect)

Opened 3 years ago

Last modified 2 years ago

Using js/css :cache when also using --prefix option for rails

Reported by: mjankowski Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

When a rails app is "mounted" at a prefix'd path (ie - mongrel_rails start --prefix=/prefix), the path that is tried to be read by the caching for JS files is wrong.

With caching on, this code...

<%= javascript_include_tag '/dir/file.js', :cache => 'simple' %>

...leads to...

<script src="/prefix/javascripts/simple.js" type="text/javascript"></script>

..which is correct.

However, the first request made prior to the cache file being written attempts to read from..

RAILS_ROOT/public/prefix/dir/file.js

..instead of...

RAILS_ROOT/public/dir/file.js

The file is written, but is empty.

Change History

04/07/08 13:38:52 changed by Coren

I have this problem too. I'll see if I can make a patch to fix it.