Wiki: titulos canonicos

This commit is contained in:
2009-09-07 07:49:16 -03:00
parent ca993b06de
commit b9924402eb
5 changed files with 38 additions and 11 deletions

View File

@@ -16,6 +16,14 @@ class String
%w[auto_link excerpt highlight sanitize simple_format strip_tags truncate word_wrap].each do |method|
eval "def #{method}(*args); ActionController::Base.helpers.#{method}(self, *args); end"
end
def pretty_url
self.mb_chars.normalize(:kd).
gsub(/[^\x00-\x7F]/n,'').
gsub(/[^a-z._0-9 -]/i,"").
gsub(/ +/,"_").
downcase.to_s
end
end
class Array