Skip to content

Instantly share code, notes, and snippets.

@viniciusalonso
Last active August 29, 2015 14:12
Show Gist options
  • Save viniciusalonso/883f9262ee6fd899326f to your computer and use it in GitHub Desktop.
Save viniciusalonso/883f9262ee6fd899326f to your computer and use it in GitHub Desktop.
# Using pure SQL
SELECT name FROM students WHERE name LIKE 'input_text%'
# Or you can use activerecored query
Student.select(:name).where("name LIKE '#{params[:input_text]}%'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment