Created
October 29, 2012 16:10
-
-
Save madwork/3974516 to your computer and use it in GitHub Desktop.
Urlize
This file contains 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
module Urlize | |
def urlize | |
self.gsub(/[^[:alnum:]\-\s\_]/, '').split(/[\s\-\_]+/).delete_if{|i| i.empty?}.join('-').downcase | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment