mirror of
https://github.com/danbee/slugtastic
synced 2025-03-04 08:49:05 +00:00
10 lines
254 B
Ruby
10 lines
254 B
Ruby
require "slugtastic/version"
|
|
require "slugtastic/model_additions"
|
|
require "slugtastic/railtie" if defined? Rails
|
|
|
|
module Slugtastic
|
|
def self.generate_slug(string)
|
|
string.downcase.gsub(/ /, '_').gsub(/[^a-z0-9\-_]/, '') unless string.nil?
|
|
end
|
|
end
|