Created
October 18, 2010 17:46
-
-
Save advorak/632657 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
params[:id] = 1 | |
Artist.where("lastname LIKE '(?)*'",params[:id]) | |
# This generates the following query: | |
# SELECT "artists".* FROM "artists" WHERE (lastname LIKE '('a')*') | |
# Note how you don't want the apostrophe within your "where" query ... | |
Artist.where("lastname LIKE ?",params[:id]) | |
# The above generates: | |
# SELECT "artists".* FROM "artists" WHERE (lastname LIKE 'a') | |
# Now this doesn't solve your problem, but it might give you a starting point toward a solution.. | |
Artist.where("username LIKE ?","a%") | |
# Might be what you're looking for? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment