title: Getting controller name from a request.referer in Rails
body: <p>I know I can use <code>request.referrer</code> to get the full referrer URL in Rails, but is there a way to just get the controller name from the URL?</p>
  
  <p>I want to see if the URL of <a href="http://myurl.com/profiles/2" rel="noreferrer">http://myurl.com/profiles/2</a> includes "profiles"</p>
  
  <p>I know I can use a regex to do it but I wondered if there was a better way.</p>