Forum: Ruby on Rails Routing Module to mixin

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3125c77bab66fa37dfdbe78eb29339b6?d=identicon&s=25 Dean (Guest)
on 2007-04-11 09:51
(Received via mailing list)
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
This topic is locked and can not be replied to.