This project is archived and is in readonly mode.

#3365 ✓resolved
Jeremy Wilkins

Action Caching is returning wrong page

Reported by Jeremy Wilkins | October 11th, 2009 @ 05:45 PM

I've just upgraded an app from Rails 2.2 to Rails 2.3.4

One of the controllers is non restful delivering news items from

/news/view/1 or /news/view/2

and at the top of the controller there's

caches_action :index, :view

Since rails 2.3 the action caching is always delivering the first news page you look at, even when going to urls for subsequent news pages.

Strangely I've just built a sample app from scratch using scaffolding converted to 'non-restful' and the action caching does work correctly there.

Just to clarify - this is working correctly in rails 2.2



Comments and changes to this ticket

  • David Trasbo

    David Trasbo April 11th, 2010 @ 07:10 PM

    • Assigned user set to “Ryan Bigg”


    I was unable to duplicate this issue on Rails 2.3.5:

    ➜  code  rails -v
    Rails 2.3.5
    ➜  code  rails action_caching
    ➜  code  cd action_caching 
    ➜  action_caching  script/generate controller news index view
    class NewsController < ApplicationController
      caches_action :index, :view
      def index
      def view
        render :text => params[:id]
    ActionController::Routing::Routes.draw do |map|
      map.connect ':controller/:action/:id'
      map.connect ':controller/:action/:id.:format'

    /news/view/1 and /news/view/2 show the correct numbers respectively.

    Unless I've missed something, this ticket can safely be marked as resolved.

  • Ryan Bigg

    Ryan Bigg April 11th, 2010 @ 09:27 PM

    • State changed from “new” to “resolved”

    Thanks David.

    Jeremy, if this is still an issue please re-open this ticket.

  • csnk

    csnk May 18th, 2011 @ 08:23 AM

    • Importance changed from “” to “”

Create your profile

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

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>