aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/inflector.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-09-11 16:03:38 +0200
committerMichael Koziarski <michael@koziarski.com>2008-09-11 17:10:17 +0200
commit1ddde91303883b47f2215779cf45d7008377bd0d (patch)
treea1a389cba8c08504bad19fcf4d8340cc554e8cee /activesupport/lib/active_support/inflector.rb
parent46bac29de7e39bd2af6ed6cfba0498a921b5213e (diff)
downloadrails-1ddde91303883b47f2215779cf45d7008377bd0d.tar.gz
rails-1ddde91303883b47f2215779cf45d7008377bd0d.tar.bz2
rails-1ddde91303883b47f2215779cf45d7008377bd0d.zip
Flesh out the parameterize method to support non-ascii text and underscores.
Diffstat (limited to 'activesupport/lib/active_support/inflector.rb')
-rw-r--r--activesupport/lib/active_support/inflector.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb
index e5f0063285..8a917a9eb2 100644
--- a/activesupport/lib/active_support/inflector.rb
+++ b/activesupport/lib/active_support/inflector.rb
@@ -257,7 +257,7 @@ module ActiveSupport
# <%= link_to(@person.name, person_path %>
# # => <a href="/person/1-donald-e-knuth">Donald E. Knuth</a>
def parameterize(string, sep = '-')
- string.gsub(/[^a-z0-9]+/i, sep).downcase
+ string.chars.normalize(:kd).to_s.gsub(/[^\x00-\x7F]+/, '').gsub(/[^a-z0-9_\-]+/i, sep).downcase
end
# Create the name of a table like Rails does for models to table names. This method