jeudi 7 avril 2016

undefined method `page' for nil:NilClass, paginate_with_kaminari

I am using paginate_with_kaminari gem for implementing pagination in my rails application. Sometimes I get this error "undefined method `page' for nil:NilClass".

@notifications = paginate current_user.push_records.where(:n_status.in => [PushRecord::N_STATUS[:NEW_REGISTERED],PushRecord::N_STATUS[:UNINSTALLED]]).to_a , per_page: 20

In the above code, params[:page] will be present which contains page number which has to be fetched.

Aucun commentaire:

Enregistrer un commentaire