Is there a method to return a hash of the route configuration based on a path? For example: magic_method(''/my_controller/my_action/my_id'') => {:controller => ''my_controller'', :action => ''my_action'', :id => ''my_id''} Thanks! Tom --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Nov 16, 2007, at 12:21 PM, TomRossi7 wrote:> Is there a method to return a hash of the route configuration based on > a path? > > For example: > > magic_method(''/my_controller/my_action/my_id'') > => > {:controller => ''my_controller'', :action => ''my_action'', :id => > ''my_id''}recognize_path(''/my_controller/my_action/my_id'') -- gw (www.railsdev.ws) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Excellent! That is exactly what I am looking for except I can''t seem to figure out how to call the method. From an IRB console:>> ActionController::Routing::RouteSet.recognize_path(''/my_controller/my_action/my_id'') NoMethodError: undefined method `recognize_path'' for ActionController::Routing::RouteSet:Class I am running Rails 1.2.5 if that matters. Thanks! Tom On 11/16/07, Greg Willits <lists-0Bv1hcaDFPRk211Z5VL+QA@public.gmane.org> wrote:> > > On Nov 16, 2007, at 12:21 PM, TomRossi7 wrote: > > > Is there a method to return a hash of the route configuration based on > > a path? > > > > For example: > > > > magic_method(''/my_controller/my_action/my_id'') > > => > > {:controller => ''my_controller'', :action => ''my_action'', :id => > > ''my_id''} > > > > recognize_path(''/my_controller/my_action/my_id'') > > > > -- gw (www.railsdev.ws) > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi -- On Fri, 16 Nov 2007, Tom Rossi wrote:> Excellent! That is exactly what I am looking for except I can''t seem to > figure out how to call the method. >> From an IRB console: > >>> ActionController::Routing::RouteSet.recognize_path > (''/my_controller/my_action/my_id'') > NoMethodError: undefined method `recognize_path'' for > ActionController::Routing::RouteSet:ClassActionController::Routing::Routes.recognize_path David -- Upcoming training by David A. Black/Ruby Power and Light, LLC: * Advancing With Rails, Berlin, Germany, November 19-22 * Intro to Rails, London, UK, December 3-6 (by Skills Matter) See http://www.rubypal.com for details! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---