In my rails application i have an SQL query tha tuses where and like to search for a query (params[:q]). How can i change it so query/:q cant be anywhere within the row, but must BEGIN with it? Here the code:
AccountNumber.where("account_number like?", "%#{params[:q]}%")
Remove the leading
%wildcard from the string.