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
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, :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.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs