Created
May 1, 2009 13:19
-
-
Save vitaliel/105038 to your computer and use it in GitHub Desktop.
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
# add chars at beginning, last should be \\ | |
BAD_URL_CHARS = "<>\"'\r\n #:/&;,%.=?\\" | |
# This id will be used in links | |
def to_param | |
if new_record? | |
"new-milestone" | |
else | |
"#{id}-#{title.tr(BAD_URL_CHARS, "-")}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment