Find collection where :name beings with a letter

All -

I want to find a collection of records where name begins with the same
letter as my_string. How would I do that? Something along the lines of:

Records.find(:all,:conditions=>{:name=>my_string[0].chr})

Thanks,
Drew

find all records where name starts with the first char of my_string

find(:all, :conditions => [“name_column LIKE ?”, “#{my_string.first}%”])

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs