Hi, I have a URL value (session[:return_to]) that I want to derive the action and controller from. Essentially what the routing system does for an actual web request when it puts together the params hash. My search-foo is letting me down. What is the best method to get back the action and controller from a URL? TIA, Walter -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
To answer my own question: from_url = ActionController::Routing::Routes.recognize_path(url, :method => :get) Returns a hash of what I was after. Cheers, Walter On Thu, Nov 4, 2010 at 1:59 PM, Walter McGinnis <walter.mcginnis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I have a URL value (session[:return_to]) that I want to derive the > action and controller from. Essentially what the routing system does > for an actual web request when it puts together the params hash. > > My search-foo is letting me down. What is the best method to get back > the action and controller from a URL? > > TIA, > Walter >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Nov 4, 2010 at 8:59 AM, Walter McGinnis <walter.mcginnis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> My search-foo is letting me down. What is the best method to get back > the action and controller from a URL? >ActionController::Routing::Routes.recognize_path(path, method). -- Erol M. Fornoles http://github.com/Erol http://twitter.com/erolfornoles http://ph.linkedin.com/in/erolfornoles -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.