Neil Hoyne
2007-Jun-25 18:10 UTC
Performing finds on the first two characters on any entry
I have a basic find request where I am retrieving any records that match the first and last name provided in an earlier form. It''s almost like a directory lookup. @master = Master.find(params[:id], :conditions => { :firstname => @contact.firstname, :lastname => @contact.lastname}) What I can''t figure out, however, is how to perform the find to handle name variations. For instance, Mike vs. Michael or Kate vs. Katie. While it''s not perfect, I''d like to get closer to the result by having the find pull all records that have an identical last name and begin with the first two characters of the first name provided. I tried a few variations, but I''m getting hung up on how to find something that is not an exact match. Any suggestions would be appreciated! -- 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 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 -~----------~----~----~----~------~----~------~--~---