# Parsing a referer into routes?

**URL:** <https://www.ruby-forum.com/t/parsing-a-referer-into-routes/121870>\
**Category:** Rails\
**Created:** [December 2, 2007, 6:18am UTC](https://www.ruby-forum.com/t/parsing-a-referer-into-routes/121870 "2007-12-02T06:18:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![markthomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Post date:** [December 2, 2007, 6:18am UTC](https://www.ruby-forum.com/t/parsing-a-referer-into-routes/121870/1 "2007-12-02T06:18:15Z")

</div>

Is there any built-in way to take a full URI ([http://host/controller/](http://host/controller/)  
action/id) and parse it into a route (following all the currently-  
defined routing rules) with :controller, :action, and :id?

In other words, I’d like to do manually what is done automagically by  
Rails. I need to extract the information from a referer (of sorts) to  
determine what controller, action, and id were specified. I want it to  
be subject to the current routing rules, not hardcoded.

Is there a built-in method in ActionController for this?

- Mark.
