# Newbie: Simple Routes

**URL:** <https://www.ruby-forum.com/t/newbie-simple-routes/146489>\
**Category:** Rails\
**Created:** [August 21, 2008, 4:36pm UTC](https://www.ruby-forum.com/t/newbie-simple-routes/146489 "2008-08-21T16:36:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jazcyk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@jazcyk](https://www.ruby-forum.com/u/jazcyk)\
**Post date:** [August 21, 2008, 4:36pm UTC](https://www.ruby-forum.com/t/newbie-simple-routes/146489/1 "2008-08-21T16:36:43Z")

</div>

Hi,

Just after some advice on routes, this is the first time I’ve played  
with them.

I had a site which used “[http://www.example.com/rss.xml](http://www.example.com/rss.xml)” at the root of  
the site for the RSS feed. My new Rails powered site however uses  
generated rss at “[http://www.example.com/posts/feed](http://www.example.com/posts/feed)”. (That is, I have a  
posts controller with the method ‘feed’ which falls through to an xml  
template).

What is the best way for me to forward requests for the rss.xml file to  
the new posts/feed controller method?

Can I do this with routes? If so, perhaps someone could nudge me in the  
right direction.

Would this be better done with a redirect at the webserver?

Any advice is, as always much appreciated,

- N

---

<div class="post-metadata">

**Author:** ![jazcyk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@jazcyk](https://www.ruby-forum.com/u/jazcyk)\
**Post date:** [August 21, 2008, 4:44pm UTC](https://www.ruby-forum.com/t/newbie-simple-routes/146489/2 "2008-08-21T16:44:09Z")

</div>

Add this to routes and tell me if it works for you.

map.rss\_feed “/rss.xml”, :controller =\> “posts”, :action =\> “feed”

Just make sure you put it above your other routes.

On Thu, Aug 21, 2008 at 9:36 AM, Peter L. \<

---

<div class="post-metadata">

**Author:** ![jazcyk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@jazcyk](https://www.ruby-forum.com/u/jazcyk)\
**Post date:** [August 21, 2008, 4:47pm UTC](https://www.ruby-forum.com/t/newbie-simple-routes/146489/3 "2008-08-21T16:47:53Z")

</div>

Thanks Brian,

I had tried this, but I got the error “Only get, head, post, put, and  
delete requests are allowed.”. After your suggestion I decided to really  
make sure and restarted the server. Now it works 🙂

Thanks for the prompt!

- N

---

<div class="post-metadata">

**Author:** ![jazcyk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@jazcyk](https://www.ruby-forum.com/u/jazcyk)\
**Post date:** [August 21, 2008, 6:50pm UTC](https://www.ruby-forum.com/t/newbie-simple-routes/146489/4 "2008-08-21T18:50:14Z")

</div>

Just an FYI - I’ve seen that happen a lot recently. Doing what you did  
seems  
to resolve it.

On Thu, Aug 21, 2008 at 9:47 AM, Peter L. \<
