Page cache is ignoring pagination params

My app’s homepage uses pagination. I would like to page cache
each page of that pagination but i’m having difficulty getting
rails to generate different files for each page, instead it tries
to create index.html regardless of which page number i’m viewing.

##############################
#routes.rb
map.connect ‘’, :controller=>‘questions’
map.connect ‘questions/:page’, :controller=>‘questions’
##############################

##############################
#QuestionsController.rb
caches_page :index
def index

paginate code that uses params[:page] if available

end
##############################

If I access “/” with my browser, index.html gets created in the
page cache directory. When I access “/questions/2”, the
pagination works correctly, and rails tries to create a new cache
file. But this new file is also called index.html while I had
expected ‘questions/2.html’ to be created.

Is it clear to anyone what I’m doing wrong here? or how i can
alter things to get the result i was expecting? thanks in
advance!

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