<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *Edge*
 
+* Added Inflector#parameterize for easy slug generation (&quot;Donald E. Knuth&quot;.parameterize =&gt; &quot;donald-e-knuth&quot;) #713 [Matt Darby]
+
 * Changed cache benchmarking to be reported in milliseconds [DHH]
 
 * Fix Ruby's Time marshaling bug in pre-1.9 versions of Ruby: utc instances are now correctly unmarshaled with a utc zone instead of the system local zone [#900 state:resolved] [Luca Guidi, Geoff Buesing]</diff>
      <filename>activesupport/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -87,6 +87,25 @@ module ActiveSupport #:nodoc:
           Inflector.demodulize(self)
         end
 
+        # Replaces special characters in a string so that it may be used as part of a 'pretty' URL.
+        # 
+        # ==== Examples
+        #
+        #   class Person
+        #     def to_param
+        #       &quot;#{id}-#{name.parameterize}&quot;
+        #     end
+        #   end
+        # 
+        #   @person = Person.find(1)
+        #   # =&gt; #&lt;Person id: 1, name: &quot;Donald E. Knuth&quot;&gt;
+        # 
+        #   &lt;%= link_to(@person.name, person_path %&gt;
+        #   # =&gt; &lt;a href=&quot;/person/1-donald-e-knuth&quot;&gt;Donald E. Knuth&lt;/a&gt;
+        def parameterize
+          Inflector.parameterize(self)
+        end
+
         # Creates the name of a table like Rails does for models to table names. This method
         # uses the +pluralize+ method on the last word in the string.
         #</diff>
      <filename>activesupport/lib/active_support/core_ext/string/inflections.rb</filename>
    </modified>
    <modified>
      <diff>@@ -240,6 +240,25 @@ module ActiveSupport
     def demodulize(class_name_in_module)
       class_name_in_module.to_s.gsub(/^.*::/, '')
     end
+    
+    # Replaces special characters in a string so that it may be used as part of a 'pretty' URL.
+    # 
+    # ==== Examples
+    #
+    #   class Person
+    #     def to_param
+    #       &quot;#{id}-#{name.parameterize}&quot;
+    #     end
+    #   end
+    # 
+    #   @person = Person.find(1)
+    #   # =&gt; #&lt;Person id: 1, name: &quot;Donald E. Knuth&quot;&gt;
+    # 
+    #   &lt;%= link_to(@person.name, person_path %&gt;
+    #   # =&gt; &lt;a href=&quot;/person/1-donald-e-knuth&quot;&gt;Donald E. Knuth&lt;/a&gt;
+    def parameterize(string, sep = '-')
+      string.gsub(/[^a-z0-9]+/i, sep).downcase
+    end
 
     # Create the name of a table like Rails does for models to table names. This method
     # uses the +pluralize+ method on the last word in the string.</diff>
      <filename>activesupport/lib/active_support/inflector.rb</filename>
    </modified>
    <modified>
      <diff>@@ -98,6 +98,12 @@ class InflectorTest &lt; Test::Unit::TestCase
     end
   end
 
+  def test_parameterize
+    StringToParameterized.each do |some_string, parameterized_string|
+      assert_equal(parameterized_string, ActiveSupport::Inflector.parameterize(some_string))
+    end
+  end
+
   def test_classify
     ClassNameToTableName.each do |class_name, table_name|
       assert_equal(class_name, ActiveSupport::Inflector.classify(table_name))</diff>
      <filename>activesupport/test/inflector_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -142,6 +142,11 @@ module InflectorTestCases
     &quot;NodeChild&quot;        =&gt; &quot;node_children&quot;
   }
 
+  StringToParameterized = {
+    &quot;Donald E. Knuth&quot;                     =&gt; &quot;donald-e-knuth&quot;,
+    &quot;Random text with *(bad)* characters&quot; =&gt; &quot;random-text-with-bad-characters&quot;
+  }
+
   UnderscoreToHuman = {
     &quot;employee_salary&quot; =&gt; &quot;Employee salary&quot;,
     &quot;employee_id&quot;     =&gt; &quot;Employee&quot;,</diff>
      <filename>activesupport/test/inflector_test_cases.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b141624abbd1be6aa9836708fe4c20c03af5ab3b</id>
    </parent>
  </parents>
  <author>
    <name>David Heinemeier Hansson</name>
    <email>david@loudthinking.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/b8e8be83e952163e225f9b38bd7251cba9c44f38</url>
  <id>b8e8be83e952163e225f9b38bd7251cba9c44f38</id>
  <committed-date>2008-09-09T22:26:50-07:00</committed-date>
  <authored-date>2008-09-09T22:26:50-07:00</authored-date>
  <message>Added Inflector#parameterize for easy slug generation (&quot;Donald E. Knuth&quot;.parameterize =&gt; &quot;donald-e-knuth&quot;) #713 [Matt Darby]</message>
  <tree>42887c2ce47fd11cf634406e1a109f35f020bdf8</tree>
  <committer>
    <name>David Heinemeier Hansson</name>
    <email>david@loudthinking.com</email>
  </committer>
</commit>
