If the params[:order][:name] parameter is left blank on your search
form, you could do something like this in your controller:
unless params[:order][:name].blank?
params[:order][:name] += '%'
else
params[:order][:name] = '%'
end
yet_more = Order.find(:all, :conditions => ["name LIKE :name AND
pay_type = :pay_type", params[:order]])
That way, if the field is left blank on the search form, the
Order.find() method will include all names, and just match on the
pay_type. I don't know if I'd call it more elegant, but it's a bit
more explicit in what the code is doing.