This project is archived and is in readonly mode.

#1244 ✓ resolved
Mike Burns

caches_page does not respect Accept header

Reported by Mike Burns | October 21st, 2008 @ 07:15 PM | in 3.x

This little snippet in our JobsController was causing an issue:

caches_page :index, :if => Proc.new {|c| c.request.format.xml?}

When requested as /jobs.xml it would create the file public/jobs.xml . However, when requested as /jobs with a header of 'Accept: text/xml' it would render the XML but cache to public/jobs.html . This meant GET /jobs.html would now produce XML.

Attached is a patch with tests and a possible solution to the problem.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

Referenced by

Pages