why is will_paginate throwing an expected 1 given 2 error?

215 Views Asked by At

I have an issue where legacy code for pagination was implemented prior to me being hiring failed randomly today. I am running a heroku app with rails and using will_paginate for pagination. In my controller I have

`

def index
    @publications = Publication.paginate(page: params[:page], per_page: 11).order('sort_date DESC')
  end

`

in my view i have

`

<div class="container">
     <%= will_paginate @publications %>
</div>

`

It throws the following error(which is leading to a 500 error in turn): wrong number of arguments(given 2, expected 1) for will_paginate.

change the .paginate function parameters to be(:page => params[:page], :per_page => 11) as mentioned in the will_paginate documentation it still throws the same error. if i delete the per_page option it also still throws the same given 2 expected 1 error. i've also updated will-paginate and still get the same error

0

There are 0 best solutions below