Search code examples
ruby-on-railswill-paginateruby-on-rails-4.2

Rails 4.2 will_paginate error


Trying to upgrade to Rails 4.2 from 4.1.8 and I'm getting a "wrong number of arguments (2 for 0..1)" for this line:

<%= will_paginate(@search) %> 

Works perfectly find in Rails 4.1.8. @search is a custom object which defines the methods will_paginate needs (total_pages, etc).

The method signature for will_paginate is:

def will_paginate(collection = nil, options = {}) #:nodoc:

And I verified the proper method is being called by using:

<%= self.method(:will_paginate).source_location %>

Which outputted:

["/Users/home/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/will_paginate-3.0.7/lib/will_paginate/view_helpers/action_view.rb", 26]

Kind of stumped, and surprised that nobody else has encountered this issue.


Solution

  • Turns out the bartt-ssl_requirement gem overrides :url_for in a way that is not compatible with Rails 4.2. Removing that gem resolved the issue.