Method: String#to_permalink
- Defined in:
- lib/core_ext/string.rb
#to_permalink ⇒ Object
Transform the current string into a permalink.
3 4 5 |
# File 'lib/core_ext/string.rb', line 3 def to_permalink self.gsub(/\W+/, ' ').strip.downcase.titleize.gsub(/\ +/, '_') end |