From: Bruno Celeste Date: 2005-09-27T22:51:05+09:00 Subject: Re: RAILS question, sql statements Hi :) > i have a few question: > > -how can i make, that the user doesnt need to fill in the full name, just > 1st or a couple of letters, in php i can use the % ==> '%first_name%', seems > not to work here You can use: @employee_pages, @employees = paginate (:employee, :conditions => ["firm_id = ? and first_name like '%#{first_name}%' and last_name like '%#{first_name}%'" , firm_id, :order_by => "last_name ASC", :per_page => 10) > -the search engine is on the same page as the results, but the first time > the parameters arent there, so i just want to show all employees, if the > parameters are there then i show those. > How can i check if the parameters are there, in php u can u isset( > *_POST["last_name"] ), what is that here? if @params['last_name'] #parameter given else #parameter not given end