Hi, Is there some conflict with naming a route "categories"? i.e. map.categories ''/categories/:url'', :controller => ''categories'', :action => ''show'' gives me an error "wrong number of arguments (2 for 0) where as map.my_categories ''/categories/:url'', :controller => ''categories'', :action => ''show'' works as expected.
On Sep 25, 2005, at 2:15 PM, Joe Van Dyk wrote:> Hi, > > Is there some conflict with naming a route "categories"?Yes, see routing.rb: # Defines a new named route with the provided name and arguments. # This method need only be used when you wish to use a name that a RouteSet instance # method exists for, such as categories. # # For example, map.categories ''/categories'', :controller => ''categories'' will not work # due to RouteSet#categories. def named_route(name, path, hash = {}) You''ll have to use the named_route method directly. -- Scott Barron Lunchbox Software http://lunchboxsoftware.com http://lunchroom.lunchboxsoftware.com http://rubyi.st
On 9/25/05, Scott Barron <scott-HDQKq3lYuGDk1uMJSBkQmQ@public.gmane.org> wrote:> > On Sep 25, 2005, at 2:15 PM, Joe Van Dyk wrote: > > > Hi, > > > > Is there some conflict with naming a route "categories"? > > Yes, see routing.rb: > > # Defines a new named route with the provided name and arguments. > # This method need only be used when you wish to use a name that > a RouteSet instance > # method exists for, such as categories. > # > # For example, map.categories ''/categories'', :controller => > ''categories'' will not work > # due to RouteSet#categories. > def named_route(name, path, hash = {}) > > You''ll have to use the named_route method directly.That''s not in 0.13.1, right?
On 25.9.2005, at 23.25, Joe Van Dyk wrote:>> Yes, see routing.rb: >> >> # Defines a new named route with the provided name and >> arguments. >> # This method need only be used when you wish to use a name >> that >> a RouteSet instance >> # method exists for, such as categories. >> # >> # For example, map.categories ''/categories'', :controller => >> ''categories'' will not work >> # due to RouteSet#categories. >> def named_route(name, path, hash = {}) >> >> You''ll have to use the named_route method directly. >> > > That''s not in 0.13.1, right?Right, it''s in trunk only. //jarkko -- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails