diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2010-07-03 09:01:01 +0100 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2010-07-03 09:01:01 +0100 |
commit | 52e526a8e3ed3682ae2b774e4a328b9aa8bd6dde (patch) | |
tree | 01fd97533bbb86e15b7ba51645092341af6f972e /railties/guides/source | |
parent | 5360014a5d77e8b6db71530dae49ac651392536d (diff) | |
download | rails-52e526a8e3ed3682ae2b774e4a328b9aa8bd6dde.tar.gz rails-52e526a8e3ed3682ae2b774e4a328b9aa8bd6dde.tar.bz2 rails-52e526a8e3ed3682ae2b774e4a328b9aa8bd6dde.zip |
:singular is no longer a valid option for resources [#5037 state:resolved]
Diffstat (limited to 'railties/guides/source')
-rw-r--r-- | railties/guides/source/routing.textile | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index 9ff06856c3..3562030aa9 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -714,14 +714,14 @@ Rails now creates routes to the +CategoriesControlleR+. h4. Overriding the Singular Form -If you want to customize the singular name of the route in the named helpers, you can use the +:singular+ option. +If you want to define the singular form of a resource, you should add additional rules to the +Inflector+. <ruby> -resources :teeth, :singular => "tooth" +ActiveSupport::Inflector.inflections do |inflect| + inflect.irregular 'tooth', 'teeth' +end </ruby> -TIP: If you want to define the singular form of a word for your entire application, you should add additional rules to the +Inflector+ instead. - h4(#nested-name-prefix). Using +:name_prefix+ in Nested Resources The +:name_prefix+ option overrides the automatically-generated prefix for the parent resource in nested route helpers. For example, |