Hi, I would like to append ".rss", straight to my action, ex. "/controller/action.rss". However it seems that I have to use "host/action/1.rss" (or another ID-parameter), otherwise I get a routing error "No route matches "/controller/action.rss" with {:method=>:get} What am I missing? Thanks! -- 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 -~----------~----~----~----~------~----~------~--~---
Greg Donald
2008-Feb-01 21:45 UTC
Re: Do I have to pass the ID-parameter when using respond_to?
On Jan 31, 2008 11:54 AM, Gu stav <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi, > I would like to append ".rss", straight to my action, ex. > "/controller/action.rss". However it seems that I have to use > "host/action/1.rss" (or another ID-parameter), otherwise I get a routing > error "No route matches "/controller/action.rss" with {:method=>:get}Add a custom route, something like: map.connect ''foo/:rss'', :controller => ''foo'', :action => ''bar'', :requirements => { :rss => /^[\w]+\.rss$/ } -- Greg Donald http://destiney.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 -~----------~----~----~----~------~----~------~--~---