The opposite of url_for?

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

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

ActionController::Routing::Routes.recognize_path(path, method).