# Pagination error using named routes

**URL:** <https://www.ruby-forum.com/t/pagination-error-using-named-routes/109680>\
**Category:** Rails\
**Created:** [July 17, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/pagination-error-using-named-routes/109680 "2007-07-17T20:32:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![janeden](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@janeden](https://www.ruby-forum.com/u/janeden)\
**Post date:** [July 17, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/pagination-error-using-named-routes/109680/1 "2007-07-17T20:32:24Z")

</div>

Hi,

I repeatedly get pagination errors (cannot convert Fixnum to String)  
when using a certain order of routes. This order works fine:

map.connect ‘maerchen’, :controller =\> ‘pages’, :action =\> ‘index’,  
:id =\> 8  
map.connect ‘erzaehlungen’, :controller =\> ‘pages’, :action =\>  
‘index’, :id =\> 2597  
map.connect ‘gedichte’, :controller =\> ‘pages’, :action =\> ‘index’,  
:id =\> 7

map.connect ‘pages/:id.:format’, :controller =\> ‘pages’, :action =\>  
‘index’, :requirements =\> { :id =\> /\d+/ }  
map.connect ‘pages/:id’, :controller =\> ‘pages’, :action =\> ‘index’,  
:requirements =\> { :id =\> /\d+/ }  
map.connect ‘:id’, :controller =\> ‘pages’, :action =\> ‘index’,  
:requirements =\> { :id =\> /\d+/ }

I can access both [http://host/gedichte](http://host/gedichte) [http://host/7](http://host/7), or  
[http://host/pages/7](http://host/pages/7) to get a nice paginated output using

\<% @children\_pagination.each do |page| %\>  
\<%= link\_to\_unless((params[:page].to\_i == page.number),  
“#{(page.number_20-19).to\_s}-#{(page.number_20).to\_s}”, :page =\> page)  
%\>  
\<% end %\>

But as soon as I move one of the non-named routes to the top, the named  
URLs ([http://host/gedichte](http://host/gedichte)) etc. throw the error above.

Why is that?

Kind regards,  
Jan
