mislav/will_paginate

wrong number of arguments (given 2, expected 1)

rubydeve opened this issue · 2 comments

wrong number of arguments (given 2, expected 1)
will_paginate v3.1.8
rails v6.1.4
ruby v3.0.0

Perhaps you should give the method the right amount of arguments? Try passing 1 arguments instead of 2.

Also, when reporting issues, it helps a lot when you include the actual code that you've tried when you received an error. You did well to list the version numbers of the software that you're using, but you haven't included a code sample.

Finally, try upgrading will_paginate to the latest version!

Model:
car.rb
self.per_page = 30
Controller:
@cars = Car.paginate(page: params[:page])
View:
<%= will_paginate @cars %>

work with
will_paginate v3.3.0
rails v6.1.4
ruby v3.0.0

will_paginate v3.1.8 not work