diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb index f1e7abf4aaf12507a7cacd4b5bcf1dc63b9dd2d9..336b6db47f490ee64219c7dc23045093d05129d6 100644 --- a/activesupport/lib/active_support/inflector.rb +++ b/activesupport/lib/active_support/inflector.rb @@ -259,11 +259,15 @@ def demodulize(class_name_in_module) # # => Donald E. Knuth def parameterize(string, sep = '-') re_sep = Regexp.escape(sep) - transliterate(string). - gsub(/[^a-z0-9\-_\+]+/i, sep). # Turn unwanted chars into the separator. - squeeze(sep). # No more than one of the separator in a row. - gsub(/^#{re_sep}|#{re_sep}$/i, ''). # Remove leading/trailing separator. - downcase + # replace accented chars with ther ascii equivalents + parameterized_string = transliterate(string) + # Turn unwanted chars into the seperator + parameterized_string.gsub!(/[^a-z0-9\-_\+]+/i, sep) + # No more than one of the separator in a row. + parameterized_string.squeeze!(sep) + # Remove leading/trailing separator. + parameterized_string.gsub!(/^#{re_sep}|#{re_sep}$/i, '') + parameterized_string.downcase end