# Paginate in rails 2.3.3

**URL:** <https://www.ruby-forum.com/t/paginate-in-rails-2-3-3/173554>\
**Category:** Rails\
**Created:** [August 11, 2009, 12:24pm UTC](https://www.ruby-forum.com/t/paginate-in-rails-2-3-3/173554 "2009-08-11T12:24:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d9b06d/32.png) [@wap](https://www.ruby-forum.com/u/wap)\
**Post date:** [August 11, 2009, 12:24pm UTC](https://www.ruby-forum.com/t/paginate-in-rails-2-3-3/173554/1 "2009-08-11T12:24:11Z")

</div>

Hi all,

i want to do paging in my project.  
i am trying to using will\_paginate but i can not do it.  
i am follow following step

1. download will\_paginate and put in vendor/plugin/
2. require ‘will\_paginate’ in config/environment.rb
3. i want to use paging in image display so that in image controller

def index  
@images = Image.paginate :page =\> params[:page], :per\_page =\> 5  
respond\_to do |format|  
format.html # index.html.erb  
format.xml { render :xml =\> @images }  
end  
end

1. in Image model  
def self.per\_page  
4  
end
2. in index.html.erb  
\<%= will\_paginate @image%\>

---

<div class="post-metadata">

**Author:** ![wap](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d9b06d/32.png) [@wap](https://www.ruby-forum.com/u/wap)\
**Post date:** [August 11, 2009, 12:39pm UTC](https://www.ruby-forum.com/t/paginate-in-rails-2-3-3/173554/2 "2009-08-11T12:39:17Z")

</div>

sorry it’s my mistake i put require will\_paginate in before end in  
environment.rb so that it is not possible but i fix the problem put  
after end in environment.rb

like this  
rails  
end  
require ‘will\_paginate’
