Commit
…th".parameterize => "donald-e-knuth") #713 [Matt Darby]
- Loading branch information
There are no files selected for viewing
3 comments
on commit 90366a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, underscore would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about stripping out separators from the beginning and end of string?
“!!!Donald E. Knuth!!!”.parameterize => “donald-e-knuth”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slugalizer handles underscore and separators in beginning/end of string, and some other edge cases:
http://github.com/henrik/slugalizer
Commented about that previously in http://github.com/rails/rails/commit/b8e8be83e952163e225f9b38bd7251cba9c44f38#comments
It would be nice to see underscore (_) as an allowed character. I use those in slugs all the time, and they work fine in URLs. Use /\W+/ for the regexp, easy!