mislav/will_paginate — Issue #218: undefined method `paginate' for []:DataMapper::Collection
Author: tmishra
Created: 2012-01-09 03:27:20+00:00
State: open

Hiya,

I am trying to use will_paginate as a gem in my Rails app. I am
using Rails 3.0.5 and Ruby 1.8.7.

Here is my issue:

Gemfile:

# Pagination related
#gem 'will_paginate', '~> 3.0.0'
gem 'will_paginate', '~> 3.0.pre'

Controller action:

@foo = Foo.all(:order => [:created_at.desc]).paginate(:page => params[:page], :per_page => 1)

View code:

<%= will_paginate @foo %>

Now; trying it in my browser.

Result: [ERROR]

undefined method `paginate' for []:DataMapper::Collection

Can anyone give me a hand to sort this out or a pointer as to where I can look.

Followed : https://github.com/mislav/will_paginate/wiki/Troubleshooting for Datamapper but not much achieved: There is no test for datamapper.

Am I missing something obvious?

Thanks heaps in Advance,

-Tats