mercredi 24 avril 2019

ArgumentError in StaticPages

I had a working pagination but after some changes to the gemfile, all the pagination started throwing this error wrong number of arguments (given 0, expected 1)

The gemfile changes have brought the errors on every class that needs pagination so it could be an issue about how I am handling the gem. The error is here Showing /home/ec2-user/environment/homework_helper/app/views/assignments/assignment/_homework_answers_page.html.erb where line #3 raised:

  <%= will_paginate @assignments  %> -line  3


      <% @assignments.each do | assignment | %>

      <tr>


gem 'will_paginate',           '3.1.6'
gem 'will_paginate-bootstrap4'


 def homework_answers
   @assignment = Assignment.new
   @categories = Category.all
   @assignments = Assignment.all
   @assignments =  Assignment.paginate(page: params[:page], per_page: 10)
  end

Aucun commentaire:

Enregistrer un commentaire