# Iterating over all the named routes?

**URL:** <https://www.ruby-forum.com/t/iterating-over-all-the-named-routes/130915>\
**Category:** Rails\
**Created:** [March 4, 2008, 1:45pm UTC](https://www.ruby-forum.com/t/iterating-over-all-the-named-routes/130915 "2008-03-04T13:45:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MohsinHijazee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@MohsinHijazee](https://www.ruby-forum.com/u/MohsinHijazee)\
**Post date:** [March 4, 2008, 1:45pm UTC](https://www.ruby-forum.com/t/iterating-over-all-the-named-routes/130915/1 "2008-03-04T13:45:57Z")

</div>

Hello!  
We all know that we expose the resources in the config/routes.rb  
like this:

map.resources :account

This create a named url. But how can I iterate through all the  
available named routes?

Regards,  
Mohsin

---

<div class="post-metadata">

**Author:** ![MohsinHijazee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@MohsinHijazee](https://www.ruby-forum.com/u/MohsinHijazee)\
**Post date:** [March 4, 2008, 4:04pm UTC](https://www.ruby-forum.com/t/iterating-over-all-the-named-routes/130915/2 "2008-03-04T16:04:31Z")

</div>

On 4 Mar 2008, at 12:44, MohsinHijazee wrote:

> Hello!  
> We all know that we expose the resources in the config/routes.rb  
> like this:
> 
> map.resources :account
> 
> This create a named url. But how can I iterate through all the  
> available named routes?

Does rake routes do what you want?

Fred

---

<div class="post-metadata">

**Author:** ![MohsinHijazee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e68b1a/32.png) [@MohsinHijazee](https://www.ruby-forum.com/u/MohsinHijazee)\
**Post date:** [March 5, 2008, 8:24am UTC](https://www.ruby-forum.com/t/iterating-over-all-the-named-routes/130915/3 "2008-03-05T08:24:28Z")

</div>

On Mar 4, 6:17 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > This create a named url. But how can I iterate through all the  
> > available named routes?
> 
> Does rake routes do what you want?
> 
> Fred

No it has to be actually in the code. let me see the code of the  
routes task then…
