I have a plugin where I would like the route to be automatically included. I have previously used a method based on theme_support. My code can be found here: http://pastie.caboo.se/9026 This worked fine for a while... but there seems to have been some changes to routing in edge rails which break this method. Now I get this: undefined method `named_route'' for #<ActionController::Routing::RouteSet:0x1240fc4> (NoMethodError) What would be the preferred way now to automatically include a route from a plugin. I''ve seen several discussions about this elsewhere, but all these also seem to break down in edge. Thanks.
Have you tried RouteSet.add_named_route name, path, options ? Bob Silva http://i.nfectio.us/ -----Original Message----- From: rails-core-bounces@lists.rubyonrails.org [mailto:rails-core-bounces@lists.rubyonrails.org] On Behalf Of Chris Abad Sent: Thursday, August 17, 2006 10:08 AM To: rails-core@lists.rubyonrails.org Subject: [Rails-core] Plugin Routes I have a plugin where I would like the route to be automatically included. I have previously used a method based on theme_support. My code can be found here: http://pastie.caboo.se/9026 This worked fine for a while... but there seems to have been some changes to routing in edge rails which break this method. Now I get this: undefined method `named_route'' for #<ActionController::Routing::RouteSet:0x1240fc4> (NoMethodError) What would be the preferred way now to automatically include a route from a plugin. I''ve seen several discussions about this elsewhere, but all these also seem to break down in edge. Thanks. _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
You may want to take a look at the new routing implementation, too. The new RouteSet#draw does not yield self, it yields an instance of Mapper, which delegates to RouteSet. Thus, your custom methods need to be added on Mapper, not RouteSet. - Jamis Bob Silva wrote:> Have you tried RouteSet.add_named_route name, path, options ? > > Bob Silva > http://i.nfectio.us/ > > > > -----Original Message----- > From: rails-core-bounces@lists.rubyonrails.org > [mailto:rails-core-bounces@lists.rubyonrails.org] On Behalf Of Chris Abad > Sent: Thursday, August 17, 2006 10:08 AM > To: rails-core@lists.rubyonrails.org > Subject: [Rails-core] Plugin Routes > > I have a plugin where I would like the route to be automatically > included. I have previously used a method based on theme_support. My > code can be found here: > > http://pastie.caboo.se/9026 > > This worked fine for a while... but there seems to have been some > changes to routing in edge rails which break this method. Now I get > this: > > undefined method `named_route'' for > #<ActionController::Routing::RouteSet:0x1240fc4> (NoMethodError) > > What would be the preferred way now to automatically include a route > from a plugin. I''ve seen several discussions about this elsewhere, > but all these also seem to break down in edge. > > Thanks. > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core > > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >