Will_paginate

Dear Madam/ Sir,

This is my first post, and I am stuck it for many months.

I have below error msg:

NoMethodError (undefined method paginate' for #<Class:0x640ccc4>): app/controllers/manage_controller.rb:24:inlist’

Here is my code:

def list

#@images = Image.paginate :page => params[:page], :per_page => 5
@items = Item.paginate :page => params[:page], :per_page => 5
#@items = Item.paginate(:page => params[:page], :per_page => 10)
#@user_pages, @users = paginate ( :users, :per_page => 5 )
#@babysitters = Babysitter.cached(:list).paginate(:page =>

params[:page],:per_page => 10)
# :per_page => 10, :order => ‘created_at
DESC’
#@users = User.paginate(:page => params[:page])
#@items = Item.paginate(:page => params[:page])
#@items = Item.paginate(:page => params[:page], :per_page => 5)
#@careers = Career.paginate :page => params[:page], :per_page =>
10

end

I did add require ‘will_paginate’ after the end of environment.rb,
what else I can do now?

Thanks and Best Regards,
Jeff

On Aug 24, 8:36 am, Jeff C. [email protected] wrote:

#@users = User.paginate(:page => params[:page])
#@items = Item.paginate(:page => params[:page])
#@items = Item.paginate(:page => params[:page], :per_page => 5)
#@careers = Career.paginate :page => params[:page], :per_page =>

10

end

I did add require ‘will_paginate’ after the end of environment.rb,
what else I can do now?

Don’t do that - use config.gem to load gems (in 2,x that is - look at
bundler if you are using rails 3)

Fred

Dear

On 8月24æ—¥, 下午4時01分, Frederick C. [email protected]
wrote:

  #             :per_page => 10, :order => 'created_at
what else I can do now?

Don’t do that - use config.gem to load gems (in 2,x that is - look at
bundler if you are using rails 3)

Fred> Thanks and Best Regards,

Jeff

I write the config.gem ‘will_paginate’ in the inside of
environment.rb, but got below error msg:

undefined local variable or method ‘config’ for main Object

How to fix it? Thanks.

On 25 Aug 2010, at 10:42, Jeff C. [email protected] wrote:

You’re probably putting it in the wrong place. What does your
environment.rb look like

Fred

Yes, I put it before the end, then the is passed.

But the undefined method `paginate’ for #Class:0x6782980 is happened
again.

On 8月25æ—¥, 下午5時58分, Frederick C. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs