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" 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". (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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Laurens < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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" 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". (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 > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 Laurens < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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 > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---