Skip to content

Instantly share code, notes, and snippets.

@mxlje
Created August 3, 2015 11:05
Show Gist options
  • Save mxlje/f0888f05ca702c5f776e to your computer and use it in GitHub Desktop.
Save mxlje/f0888f05ca702c5f776e to your computer and use it in GitHub Desktop.
slug = text.downcase.gsub(/(ä|Ä|ö|Ö|ü|Ü|ß| |\?|\!)/, {
'ä' => 'ae',
'Ä' => 'ae',
'ö' => 'oe',
'Ö' => 'oe',
'ü' => 'ue',
'Ü' => 'ue',
'ß' => 'ss',
' ' => '-',
'?' => '',
'!' => '',
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment