Really simple question - how do I do a search to find all records where the name starts with a certain string in ActiveRecord. I\'ve seen all sorts of bits all over the internet
Dave Sag, I guess the first part of your code should be
class User scope :name_starts_with, (lambda do |str| {:conditions => ['lower(name) like ?', "#{str.downcase}%"]} end ) end