title: How to determine Controller class given URL string
body: <p>Within the scope of a Rails controller or a view:
  How can I query the Rails routing mechanism to turn a relative url string (eg "/controllername/action/whatever" into the controller class that would be responsible for handling that request?</p>
  
  <p>I want to do something like this:</p>
  
  <pre><code>controllerClass = someMethod("/controllername/action/whatever")
  </code></pre>
  
  <p>Where contorllerClass is an instance of Class.</p>
  
  <p>I don't want to make any assumptions about a routing convention eg. that the "controllername" in the above example is always the name of the controller (because it's not).</p>