Skip to content

Instantly share code, notes, and snippets.

@lkrych
Last active April 5, 2018 21:44
Show Gist options
  • Save lkrych/ec94116dc0d1bf492c60f76c3fcbb836 to your computer and use it in GitHub Desktop.
Save lkrych/ec94116dc0d1bf492c60f76c3fcbb836 to your computer and use it in GitHub Desktop.
Match substrings
# people is some subset from the Persons table
people = people.where("UPPER(first_name) LIKE UPPER(?) OR UPPER(last_name) LIKE UPPER(?)", "%" + params[:fname] + "%", "%" + params[:lname]+ "%")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment