Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

AS guide: documents String#pluralize

  • Loading branch information...
commit 68dd44cc62062c8f3c82dde678bf99e8f2245bb5 1 parent f3a7f0e
@fxn fxn authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 railties/guides/source/active_support_core_extensions.textile
View
16 railties/guides/source/active_support_core_extensions.textile
@@ -1249,6 +1249,22 @@ The call +str.last(n)+ is equivalent to +str.from(-n)+ if +n+ > 0, and returns a
NOTE: Defined in +active_support/core_ext/string/access.rb+.
+h4. Inflections
+
+h5. +pluralize+
+
+The method +pluralize+ returns the plural of its receiver:
+
+<ruby>
+"table".pluralize # => "tables"
+"ruby".pluralize # => "rubies"
+"equipment".pluralize # => "equipment"
+</ruby>
+
+As the previous example shows, Active Support knows some irregular plurals and a few uncountable nouns. Builtin rules can be extended in +config/initializers/inflections.rb+. That file is generated by the +rails+ command and has instructions in comments.
+
+NOTE: Defined in +active_support/core_ext/string/inflections.rb+.
+
h3. Extensions to +Numeric+
h4. Bytes
Please sign in to comment.
Something went wrong with that request. Please try again.