# Routing Module to mixin

**URL:** <https://www.ruby-forum.com/t/routing-module-to-mixin/91662>\
**Category:** Rails\
**Created:** [April 11, 2007, 9:51am UTC](https://www.ruby-forum.com/t/routing-module-to-mixin/91662 "2007-04-11T09:51:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3be4f8/32.png) [@dean](https://www.ruby-forum.com/u/dean)\
**Post date:** [April 11, 2007, 9:51am UTC](https://www.ruby-forum.com/t/routing-module-to-mixin/91662/1 "2007-04-11T09:51:09Z")

</div>

I have a need to get routes into my AR models, but I can not find the  
module that provides them to ActionController. For example, I would  
like to provide an event feed from two different locations, so want to  
do something like this;

xml.instruct! :xml, :version =\> ‘1.0’  
xml rss stuff  
@events.each do |event|  
event.to\_rss(xml)  
end

Event.rb  
def to\_rss(xml)  
xml.item do  
xml.link(event\_url(self))  
xml.guid(event\_url(self))  
end  
end

but AR (rightly) doesn’t know how to do event\_url() Where does it  
come from?

Thanks,  
–Dean
