Skip to content

Instantly share code, notes, and snippets.

@mxlje
Created August 3, 2015 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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