# Paginator: Need help with navigation.

**URL:** <https://discuss.rubyonrails.org/t/paginator-need-help-with-navigation/29340>\
**Category:** rubyonrails-talk\
**Created:** [May 13, 2008, 8:34pm UTC](https://discuss.rubyonrails.org/t/paginator-need-help-with-navigation/29340 "2008-05-13T20:34:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carson](https://avatars.discourse-cdn.com/v4/letter/c/e9bcb4/32.png) [@Carson](https://discuss.rubyonrails.org/u/Carson)\
**Post date:** [May 13, 2008, 8:34pm UTC](https://discuss.rubyonrails.org/t/paginator-need-help-with-navigation/29340/1 "2008-05-13T20:34:37Z")

</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:

&nbsp;&nbsp;&nbsp;[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
