Pls,explain about search action


#1

Hello,
i want create web page for searching items in database. i try to run
code to find items in script/console it’s work.but i have problem
about show results after find items in database finish. pls, explain
me what next step that i can do.
def search
@title = “Search”
if params[:q] #receives query from user
initial= params[:q]
seqs = Seq.find(:all, #find item in Seq database by finding the
org_name
:conditions => “org_name LIKE ‘#{initial}%’”,
:order => “seq_id, org_name”)
redirect_to :controller => “result”, :action => “index” #after
searching go to index page for show results
end
end
#######but i have problem about show results pls help me how can
create page to show result ?
thank you very much -__-


#2

Thiti Panya wrote:

Hello,
i want create web page for searching items in database. i try to run
code to find items in script/console it’s work.but i have problem
about show results after find items in database finish. pls, explain
me what next step that i can do.
def search
@title = “Search”
if params[:q] #receives query from user
initial= params[:q]
seqs = Seq.find(:all, #find item in Seq database by finding the
org_name
:conditions => “org_name LIKE ‘#{initial}%’”,
:order => “seq_id, org_name”)
redirect_to :controller => “result”, :action => “index” #after
searching go to index page for show results

I think you wrongly used redirect_to. Use the render method.
Maintain the Query result in a Instance Variable.

 end

end
#######but i have problem about show results pls help me how can
create page to show result ?
thank you very much -__-


#3

thank you very much for your help. it’s work

2009/3/30 Siddick E. removed_email_address@domain.invalid