Cache expiration with format not working as expected

Hi all,

In my OrdersController, I have two actions completed and incomplete
that respond_to HTML and CSV.

Im also action caching these actions


caches_action :completed, :incomplete

def completed
@orders = Order.completed
respond_to do |format|
format.html
format.csv {render :layout => false}
end
end

def incomplete
@orders = Order.incomplete
respond_to do |format|
format.html
format.csv {render :layout => false}
end
end

Now the cached fragments when I go to the CSV urls are

views/localhost:3001/orders/completed.csv
views/localhost:3001/orders/incomplete.csv

My sweepers have the following cache expiration commands

expire_action :controller => :orders, :action => :completed, :format
=> :csv
expire_action :controller => :orders, :action => :incomplete, :format
=> :csv

But the log says

Expired fragment : views/localhost:3001/completed.csv
Expired fragment : views/localhost:3001/incomplete.csv

notice that it missed “/orders” in there? The cache therefore never
expires for the CSV format output. It works fine for HTML though. Any
idea what im doing wrong?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs