# Using a named route from elsewhere in RoR

**URL:** <https://www.ruby-forum.com/t/using-a-named-route-from-elsewhere-in-ror/114081>\
**Category:** Rails\
**Created:** [September 7, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/using-a-named-route-from-elsewhere-in-ror/114081 "2007-09-07T18:22:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ldk2005](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d9b06d/32.png) [@ldk2005](https://www.ruby-forum.com/u/ldk2005)\
**Post date:** [September 7, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/using-a-named-route-from-elsewhere-in-ror/114081/1 "2007-09-07T18:22:03Z")

</div>

Hi Everybody,

I’m trying to use named routes (method foo\_url where foo is the route).  
I’m trying to call the method from inside a Liquid tag definition, so  
the class is _not_ a subclass of ActionController

foo\_url gets a no method error

ActionController::Routing::Routes.foo\_url and  
ActionController::Routing::Routes.named\_routes.foo\_url  
have the same error.

trying script/console:  
ActionController::Routing::Routes.named\_routes[:foo] (note: no \_url)  
gives me a ActionController::Routing::Route object. So I know the route  
is there.

But how do I invoke it or make use of it?

Ideas much appreciated.

Regards from New York City,

Larry
