# Will\_paginate

**URL:** <https://www.ruby-forum.com/t/will-paginate/160432>\
**Category:** Rails\
**Created:** [February 16, 2009, 11:15am UTC](https://www.ruby-forum.com/t/will-paginate/160432 "2009-02-16T11:15:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fRAnKEnSTEin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/0ea827/32.png) [@fRAnKEnSTEin](https://www.ruby-forum.com/u/fRAnKEnSTEin)\
**Post date:** [February 16, 2009, 11:15am UTC](https://www.ruby-forum.com/t/will-paginate/160432/1 "2009-02-16T11:15:01Z")

</div>

Hi there,

I am paginating my products using “will\_paginate”(12 items per page),  
and i added this line to my routes file, for make “wil\_paginate” work  
with friendly url’s:

map.paginated\_product ‘products/page/:page’, :controller =\>  
‘products’, :action =\> ‘index’, :page =\> 1

1- First question: when i load my product index page, i want the url  
be like “[http://localhost:3000/products/page/1](http://localhost:3000/products/page/1)” instead “http://  
localhost:3000/products/” how can i do this? in fact i want that  
“[http://localhost:3000/products/page/1](http://localhost:3000/products/page/1)” be the only url for accesing  
the products index, is this posible?

When one clicks on any product, the url becomes: “[http://localhost](http://localhost):  
3000/products/page/1/product/1” so that means that i am in page number  
1 viewing product number 1.

2- Second question: when i click any paging links, my URL changes the  
page number, but will remain the “/product/1” at the end of the url.  
So if a click on the number 2 page link, the url will look like:  
“[http://localhost:3000/products/page/2/product/1](http://localhost:3000/products/page/2/product/1)” instead of “http://  
localhost:3000/products/page/1/product/12”, product wit id 12 is the  
first one that apears in the page number 2, so i have to see that id  
product in url intead of 1, how can i do this?

Regards
