# Paginator: Need help with navigation

**URL:** <https://www.ruby-forum.com/t/paginator-need-help-with-navigation/137518>\
**Category:** Rails\
**Created:** [May 13, 2008, 10:35pm UTC](https://www.ruby-forum.com/t/paginator-need-help-with-navigation/137518 "2008-05-13T22:35:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e9bcb4/32.png) [@Carson](https://www.ruby-forum.com/u/Carson)\
**Post date:** [May 13, 2008, 10:35pm UTC](https://www.ruby-forum.com/t/paginator-need-help-with-navigation/137518/1 "2008-05-13T22:35:47Z")

</div>

In a catalog\_controller, I have a department subroutine that paginates  
departmental promotions.

In my view, I have the navigation statement:

PAGE \<%= @page\_of\_products.number %\> OF \<%= @pager.number\_of\_pages %\>  
\<%= link\_to(“Prev”, products\_url(:page =\>  
@page\_of\_products.prev.number)) if @page\_of\_products.prev? %\>  
\<%= link\_to(“Next”, products\_url(:page =\>  
@page\_of\_products.next.number)) if @page\_of\_products.next? %\>

This generates the url for next looking like this:

[http://localhost:3000/products?page=2](http://localhost:3000/products?page=2)

which generates this error message:

NameError in ProductsController#index

uninitialized constant ProductsController

Well, obviously, I don’t want ProductsController#index,  
I want CatalogController#department.

How do I change this routing? I’ve played with the routes.rb but can’t  
make it work. Is this the right approach or do I need to change the  
“Paginator” navigation statement?

Carson
