use helper method in controller?

I would highly recommend you push this back into your model if you need it in both places. This seems like business logic, which belongs in the model.

class Person < ActiveRecord::Base

… your other stuff

def self.filter_by_name_and_address(name, address)

   name = "#{name}%"
   address = "#{address}%"
   self.find(:all, conditions=>["name like ? and address like ?", name, address



Your controller might be like this now:

def list
@person_pages, @people = paginate Person.filter_by_name_and_address(params[:name], params[:address]), per_page => 50


That’s untested, btw, but it should get you going in the right direction. Helpers are really for code that is directly related to views and controllers. You want to try to keep as much db stuff in the model as you can. You might have a compelling reason to use the helper as you’d originally intended, so my apologies if this is not suitable for you.

Yes, sorry… that was a mistake on my end. I should have tested my code before I sent it to you. The built-in paginator is kinda ugly, doesn’t perform well. I’d recommend the will_paginate plugin. It will let you do what you want to do. You are correct that the paginate method doesn’t let you do what you want.