kaminari undefined method `total_pages'
Try to paginate with:
List.tagged_with(params[:tag]).order(created_at: :desc).page(params[:page]).per(3)
You need to paginate both queries. I recommend something like:
def index
if params[:tag]
@lists = List.tagged_with(params[:tag])
else
@lists = List.all
end
@lists = @lists.order(created_at: :desc).paginate(page:params[:page], per_page: 3 )
end
Otherwise @lists
will not be a pagination object when params[:tag]
is nil.