Hi
I have a form on View and I have to construct condition for query
depending fields which user filled in form.
I should write something like:

cond
if params[par1]
 cond = " par1 = #{par1} "

if params[par2]
 cond += " AND par2 = #{par2} "

etc....

Client.all(:conditions => cond)
....
....

May be someone know more rational way how to do it in RoR?
Thanks in advance!
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to