# Error with 'will\_paginate' -- need help!

**URL:** <https://www.ruby-forum.com/t/error-with-will-paginate-need-help/186419>\
**Category:** Rails\
**Created:** [April 6, 2010, 11:54pm UTC](https://www.ruby-forum.com/t/error-with-will-paginate-need-help/186419 "2010-04-06T23:54:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ironmantis7x](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e19adc/32.png) [@ironmantis7x](https://www.ruby-forum.com/u/ironmantis7x)\
**Post date:** [April 6, 2010, 11:54pm UTC](https://www.ruby-forum.com/t/error-with-will-paginate-need-help/186419/1 "2010-04-06T23:54:13Z")

</div>

My controller is as follows:

class CommunityController \< ApplicationController  
helper :profile

def index  
@title = “Community”  
@letters = “ABCDEFGHIJKLMNOPQRSTUVWXYZ”.split("")  
if params[:id]  
@initial = params[:id]  
@pages = Page.paginate :page =\> params[:page], :order =\>  
‘last\_name, first\_name’

```
end

```

end

def browse  
end

def search  
end  
end

I get the following error when I click on an index:

NameError in CommunityController#index

uninitialized constant CommunityController::Page

RAILS\_ROOT: /home/ironmantis7x/projects/mypetkingdom  
Application Trace | Framework Trace | Full Trace

/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/  
dependencies.rb:105:in `const_missing' /home/ironmantis7x/projects/mypetkingdom/app/controllers/ community_controller.rb:9:in`index’

Can someone help me out? I checked to see if I have will\_paginate  
installed and if it is loaded and it is installed correctly and it  
responds.

What am I doing wrong?

Thanks!!

ironmantis7x

---

<div class="post-metadata">

**Author:** ![ironmantis7x](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e19adc/32.png) [@ironmantis7x](https://www.ruby-forum.com/u/ironmantis7x)\
**Post date:** [April 6, 2010, 11:54pm UTC](https://www.ruby-forum.com/t/error-with-will-paginate-need-help/186419/2 "2010-04-06T23:54:48Z")

</div>

On Apr 6, 9:41 pm, ironmantis7x [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Can someone help me out? I checked to see if I have will\_paginate  
> installed and if it is loaded and it is installed correctly and it  
> responds.
> 
> What am I doing wrong?

Is your model really called Page?

Fred
