mirror of
https://github.com/tildeverse/lobsters
synced 2024-06-18 06:37:06 +00:00
Use parameterize in title_as_url
Use the Rails feature for this cleanup to catch more corner cases. Fixes #419
This commit is contained in:
parent
14a8b03f86
commit
b12e3e908f
|
@ -676,7 +676,7 @@ class Story < ActiveRecord::Base
|
|||
wl = 0
|
||||
words = []
|
||||
|
||||
self.title.downcase.gsub(/[,'`\"]/, "").gsub(/[^a-z0-9]/, "_").split("_").
|
||||
self.title.parameterize.gsub(/[^a-z0-9]/, "_").split("_").
|
||||
reject{|z| [ "", "a", "an", "and", "but", "in", "of", "or", "that", "the",
|
||||
"to" ].include?(z) }.each do |w|
|
||||
if wl + w.length <= max_len
|
||||
|
|
Loading…
Reference in New Issue
Block a user