# How to deal with caches\_page with two or more params

**URL:** <https://www.ruby-forum.com/t/how-to-deal-with-caches-page-with-two-or-more-params/120273>\
**Category:** Rails\
**Created:** [November 15, 2007, 1:03pm UTC](https://www.ruby-forum.com/t/how-to-deal-with-caches-page-with-two-or-more-params/120273 "2007-11-15T13:03:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sixfooter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@sixfooter](https://www.ruby-forum.com/u/sixfooter)\
**Post date:** [November 15, 2007, 1:03pm UTC](https://www.ruby-forum.com/t/how-to-deal-with-caches-page-with-two-or-more-params/120273/1 "2007-11-15T13:03:48Z")

</div>

I have added the new map.connect in routes.rb like this

map.connect ‘:controller/:action/:id/:page’

but it seems like the cache\_pages only create the  
controller\_name/action\_name/id.html file in the public directory.

and I expect the controller\_name/action\_name/id/page.html

for different id number the rails create a series page number html files  
in a directory named with the id.

What should I do?

I have search for a few days and can’t find the answer.

Could anyone help me?

---

<div class="post-metadata">

**Author:** ![sixfooter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@sixfooter](https://www.ruby-forum.com/u/sixfooter)\
**Post date:** [November 15, 2007, 1:16pm UTC](https://www.ruby-forum.com/t/how-to-deal-with-caches-page-with-two-or-more-params/120273/2 "2007-11-15T13:16:09Z")

</div>

Hi –

On Thu, 15 Nov 2007, Hongliang Zhang wrote:

> for different id number the rails create a series page number html files  
> in a directory named with the id.
> 
> What should I do?
> 
> I have search for a few days and can’t find the answer.
> 
> Could anyone help me?

Where in your routes.rb file do you have that route? I’m wondering  
whether another route is matching first.

Here’s what I did to simulate what you’ve got:

map.connect ‘:controller/:action/:id/:extra’

and then connected to:

[http://localhost:3000/items/show/1/extra](http://localhost:3000/items/show/1/extra)

and I got this file created:

public/items/show/1/extra.html

So it should work, which makes me think maybe it’s a route ordering  
problem.

David

–  
Upcoming training by David A. Black/Ruby Power and Light, LLC:

- Advancing With Rails, Berlin, Germany, November 19-22
- Intro to Rails, London, UK, December 3-6 (by Skills Matter)  
See [http://www.rubypal.com](http://www.rubypal.com) for details!

---

<div class="post-metadata">

**Author:** ![sixfooter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/65b543/32.png) [@sixfooter](https://www.ruby-forum.com/u/sixfooter)\
**Post date:** [November 15, 2007, 1:30pm UTC](https://www.ruby-forum.com/t/how-to-deal-with-caches-page-with-two-or-more-params/120273/3 "2007-11-15T13:30:59Z")

</div>

Thanks David.

You are right. now the cache pages are created.

Thank you very much for your help.
