# Include ActionController::Routing

**URL:** <https://www.ruby-forum.com/t/include-actioncontroller-routing/135000>\
**Category:** Rails\
**Created:** [April 16, 2008, 11:39pm UTC](https://www.ruby-forum.com/t/include-actioncontroller-routing/135000 "2008-04-16T23:39:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@dave](https://www.ruby-forum.com/u/dave)\
**Post date:** [April 16, 2008, 11:39pm UTC](https://www.ruby-forum.com/t/include-actioncontroller-routing/135000/1 "2008-04-16T23:39:33Z")

</div>

Hi there,

I was wondering how I would gain access to all the named routes  
available to an application from within a rake task. I tried to  
“include ActionController::Routing” within the rake task, but that  
doesn’t seem to work because when I specify one of my named routes in  
the rake task I get an error of “undefined local variable or method  
‘the\_url’ for main:Object”.

What else do I have to “include”?

Thank you,  
Dave

---

<div class="post-metadata">

**Author:** ![dave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@dave](https://www.ruby-forum.com/u/dave)\
**Post date:** [April 17, 2008, 9:31am UTC](https://www.ruby-forum.com/t/include-actioncontroller-routing/135000/2 "2008-04-17T09:31:08Z")

</div>

On Apr 16, 10:00 pm, Dave [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

I don’t actually know, but there is a rails supplied take task that  
lists all those routes, so I’d suggest that you poke around in the  
source for that task to begin with (it’s somewhere in railties I  
think).

Fred
