Paginate in rails 2.3.3

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%>

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’