From 7d04a4be6b744fd1de9dc906a2faf83fffc9e0cc Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sun, 4 Jul 2010 08:05:11 +0100 Subject: Reword routing guide so that we talk about prefixing as a use of :as rather than as a specific prefixing option (which :name_prefix used to be). --- railties/guides/source/routing.textile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'railties/guides') diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index 4e55b07ed7..00755071c5 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -645,9 +645,9 @@ scope :path_names => { :new => "make" } do end -h4. Overriding the Named Helper Prefix +h4. Prefixing the Named Route Helpers -You can use the :as option to rename the named route helpers that Rails generates for a route. You can use this option to prevent collisions between routes using a path scope. +You can use the +:as+ option to prefix the named route helpers that Rails generates for a route. Use this option to prevent name collisions between routes using a path scope. scope "admin" do @@ -659,7 +659,7 @@ resources :photos This will provide route helpers such as +admin_photos_path+, +new_admin_photo_path+ etc. -You could specify a name prefix to use for a group of routes in the scope: +To prefix a group of routes, use +:as+ with +scope+: scope "admin", :as => "admin" do -- cgit v1.2.3