Created
July 5, 2014 17:28
-
-
Save inky/d299cd26d7c3d51d47b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def make_slug(text) | |
| text.downcase.split.map{ |w| w.delete '^a-z0-9' }.reject(&:empty?).join('-') | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've never seen it done like this before! I usually use a couple regexpeses like this: