I can’t get past this. I know I’ve read there isn’t a page method for arrays but what do I do?
If I run Class.all in the console, it returns #, but if I run Class.all.page(1), I get the above error.
Any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No Array doesn’t have a page method.
Looks like you are using kaminari. Class.all returns an array, thus you cannot call page on it. Instead, use Class.page(1) directly.
For normal arrays, kaminari has a great helper method: