Sha256: 9bc8aee888d1c14ce3794fd064005d0c9703e54f5214d2593de553a126c2b841

Contents?: true

Size: 169 Bytes

Versions: 10

Compression:

Stored size: 169 Bytes

Contents

class String
  
  # Transforms strings into a nice, URL-friendly format
  def slugify
    self.downcase.gsub(/\W|_/, ' ').strip.squeeze(' ').gsub(/\s/, '-')
  end
  
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
comfy_blog-0.1.8 lib/comfy_blog/core_ext/string.rb
comfy_blog-0.1.7 lib/comfy_blog/core_ext/string.rb
comfy_blog-0.1.6 lib/comfy_blog/core_ext/string.rb
comfy_blog-0.1.5 lib/comfy_blog/core_ext/string.rb
comfy_blog-0.1.4 lib/comfy_blog/core_ext/string.rb
comfy_blog-0.1.3 lib/comfy_blog/core_ext/string.rb
comfy_blog-0.1.2 lib/comfy_blog/core_ext/string.rb
comfy_blog-0.1.1 lib/comfy_blog/core_ext/string.rb
comfy_blog-0.1.0 lib/comfy_blog/core_ext/string.rb
comfy_blog-0.0.0 lib/comfy_blog/core_ext/string.rb