We just ran into this problem the other day all of a sudden. Our Rails app is using will_paginate, and I have it defined as follows in my controller:
# contacts_controller.rb
def index
# ...
@search = @current_user.contacts.search(params[:search])
@contacts = @search.all.paginate({:page => params[:page], :per_page => 20})
end
Both development and staging (this is a staging box not production) point to the same database. The above code works fine on my local machine, however on staging I get the following error:
undefined method 'to_i' for {:per_page=>20, :page=>nil}:Hash
The code is identical on both computers. Any idea why it works fine on one and not on the other?
EDIT: On the staging server I was using the plugin while on my local box I was using the gem, however I removed the plugin and installed the gem and now I get an error that says:
uninitialized constant Array::WillPaginate