[typo] how does typo produce feed urls with ".xml" suffix?

Piers Cawley pdcawley at bofh.org.uk
Fri Mar 31 08:35:38 EST 2006


Stephen Bannasch <stephen at deanbrook.org> writes:

>>Stephen Bannasch <stephen at deanbrook.org> writes:
>>
>>> I'm pretty new to Ruby and Rails and I like to be able to create urls
>>> with an extension suffix similar to how Typo does this for the feed
>>> urls. However I need a bit of help understanding how this works in
>> > Typo.
>>
>>The magic's all in config/routes.rb
>>
>>Notice that we add the .xml extension there.
>
> Hi Piers,
>
> I see it now. These lines match feed urls with ".xml" at the end and route off to the feed action in XmlController.
>
>   map.xml 'xml/:format/feed.xml', :controller => 'xml', :action => 'feed', :type => 'feed'
>   map.xml 'xml/:format/:type/feed.xml', :controller => 'xml', :action => 'feed'
>   map.xml 'xml/:format/:type/:id/feed.xml', :controller => 'xml', :action => 'feed'
>
> That's one half of the answer -- the other half I'm still confused by.
>
> How do the original displayed feed urls in
> components/plugins/sidebars/xml/content.rhtml get rendered with the
> ".xml" suffix?

Routes are a two way thing.

-- 
Piers Cawley <pdcawley at bofh.org.uk>
http://www.bofh.org.uk/


More information about the Typo-list mailing list