How to approach this problem, i have a search form designed with multiselect list, checkboxes and so on. I need to combine all these things together for a sql query. Let say the SQL from the options in the search form would be: SELECT * FROM users WHERE (name LIKE ''%value%'' OR surname LIKE ''%value'' ) AND (account_type = 1 OR account_type=2) ORDER BY name ASC LIMIT 2,20 So the old way would be to do a string go thrught the params and make the sql above: string = "SELECT * FROM users" if params[:options] string += " WHERE ..." end if params ... end #and then the users=User.find_by_sql(string) Is the a object oriented approach without tons of if else statements?? ` --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---