Created
December 1, 2016 17:34
-
-
Save emad-elsaid/5e7047382b7953028d9bae3c928ff66d to your computer and use it in GitHub Desktop.
Convert string to hashtag, to use it simply drop this to a directory that is autoloaded like rails initializers and then "Hash tag".hashify it will produce "#Hash_tag"
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
class String | |
def hashify | |
"##{gsub(' ', '_')}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment