place this in your application.rb (eg)
1 2 3 4 5 |
class String def translit Unicode.normalize_KD(self).unpack('U*').select{ |cp| cp < 127 }.pack('U*').gsub(/ /,'-').downcase end end |
place this in your application.rb (eg)
1 2 3 4 5 |
class String def translit Unicode.normalize_KD(self).unpack('U*').select{ |cp| cp < 127 }.pack('U*').gsub(/ /,'-').downcase end end |