Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Action Caching is returning wrong page

#3365

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

Thanks

jebw

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

State: resolved
Milestone: none
Assigned to: Ryan Bigg Ryan Bigg
Importance: none

Activity

  1. David Trasbo
    David Trasbo
    • Assigned user set to Ryan Bigg

    Jeremy,

    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
      end
    
      def view
        render :text => params[:id]
      end
    end
    
    ActionController::Routing::Routes.draw do |map|
      map.connect ':controller/:action/:id'
      map.connect ':controller/:action/:id.:format'
    end
    

    /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.

    April 11th, 2010 @ 07:10 PM

  2. Ryan Bigg
    Ryan Bigg
    • State changed from new to resolved

    Thanks David.

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

    April 11th, 2010 @ 09:27 PM