jhund / filterrific

Filterrific is a Rails Engine plugin that makes it easy to filter, search, and sort your ActiveRecord lists.
http://filterrific.clearcove.ca
MIT License
911 stars 125 forks source link

Undefined method "page" ? (sqlserver?) #193

Closed brandonsturgeon closed 3 years ago

brandonsturgeon commented 4 years ago

I'm getting a bizarre error here that I don't see anyone else experiencing. I'm using a barebones example where I (think I) followed the examples very closely.

First things first: Versions

filterrific (5.2.1) 
rails (5.1.7)
activerecord (= 5.1.7)
BUNDLED WITH 2.1.3

ruby -v 
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin19]

This is the line that errors with "Undefined method 'page'":

@students = @filterrific.find.page(params[:page])

The one weird thing I'm doing here is using the sqlserver adapter, which, of course isn't officially supported. Is that the cause of this issue?

I saw someone on Stack Overflow saying they got filterrific to work with sqlserver "with some minor modifications", so I thought I'd give it a shot.

btrewern commented 4 years ago

The page method is from kaminari not filterrific. Try installing that.

jhund commented 3 years ago

Yes, #page method is provided by pagination library, in this case will_paginate: https://github.com/jhund/filterrific_demo/blob/0e5e38cc871ddaadb7d18f50c508039e6f893b35/Gemfile#L17