Method: Msgtrail::Slug.slugify
- Defined in:
- lib/msgtrail/slug.rb
.slugify(title) ⇒ Object
Create URL-safe slug
12 13 14 15 16 17 |
# File 'lib/msgtrail/slug.rb', line 12 def self.slugify(title) URI.encode_www_form_component(title) .gsub(/%[0-9A-F]{2}/, '-') .gsub(/-+/, '-') .downcase end |