Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/core_ext/string.rb
Instance Method Summary collapse
Instance Method Details
#to_permalink ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/core_ext/string.rb', line 2 def to_permalink # Pinched: http://github.com/jrun/merb_permalink_fu/tree/master/lib/merb_permalink_fu/permalink_fu.rb string = self string = string.gsub(/\W+/, ' ') string = string.strip string = string.downcase string = string.gsub(/\ +/, '-') # spaces to dashes, preferred separator char everywhere end |