discourse/lib/slug.rb

13 lines
281 B
Ruby
Raw Normal View History

2013-02-05 14:16:51 -05:00
# encoding: utf-8
2013-02-25 11:42:20 -05:00
# Generates a slug. This is annoying beacuse it's duplicating what the javascript
2013-02-05 14:16:51 -05:00
# does, but on the other hand slugs are never matched so it's okay if they differ
# a little.
module Slug
def self.for(string)
2013-02-14 17:46:11 -05:00
string.parameterize.gsub("_", "-")
2013-02-05 14:16:51 -05:00
end
end