From 26149260bfe5aaee162586e6d1fa54365f8a773e Mon Sep 17 00:00:00 2001 From: Oscar Del Ben Date: Fri, 25 May 2012 08:59:00 -0700 Subject: [Guides] Add inflector example --- guides/source/initialization.textile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/guides/source/initialization.textile b/guides/source/initialization.textile index fe777d063b..89bb0bba84 100644 --- a/guides/source/initialization.textile +++ b/guides/source/initialization.textile @@ -752,6 +752,10 @@ h4. +active_support/inflections+ This file references the +ActiveSupport::Inflector+ constant which isn't loaded by this point. But there were autoloads set up in +activesupport/lib/active_support.rb+ which will load the file which loads this constant and so then it will be defined. Then this file defines pluralization and singularization rules for words in Rails. This is how Rails knows how to pluralize "tomato" to "tomatoes". + +inflect.irregular('zombie', 'zombies') + + h4. +activesupport/lib/active_support/inflector/transliterate.rb+ In this file is where the "+transliterate+":http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-transliterate and +parameterize+:http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-parameterize methods are defined. The documentation for both of these methods is very much worth reading. -- cgit v1.2.3