# Access named routes outside controller or view

**URL:** <https://www.ruby-forum.com/t/access-named-routes-outside-controller-or-view/104968>\
**Category:** Rails\
**Created:** [May 24, 2007, 12:40pm UTC](https://www.ruby-forum.com/t/access-named-routes-outside-controller-or-view/104968 "2007-05-24T12:40:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![reynar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e99b99/32.png) [@reynar](https://www.ruby-forum.com/u/reynar)\
**Post date:** [May 24, 2007, 12:40pm UTC](https://www.ruby-forum.com/t/access-named-routes-outside-controller-or-view/104968/1 "2007-05-24T12:40:13Z")

</div>

Hi,

Could anyone advise if it’s possible to access named routes in regular  
class within a rails application.

I am working on a system to define menu structure with a rails app.  
Rather than using something like :controller =\> user, :action =\> index  
for each menu item, it would make things simpler if I could tap into the  
named routes methods such as ‘users\_url’ as generated by map.resources  
:users

I haven’t quite got enough knowledge of rails framework to work this one  
out yet.

Thanks, Andrew.
